summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2020-04-27 14:50:37 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-01 12:47:08 +0100
commitd07ca3e7bab81e6981a2fc006ba6852d5653f174 (patch)
treed77b331a61f598d849b36430fe6b15f58f437e44 /include/linux
parent35a1d6270d451d5e7fffca87f965be5e266a7916 (diff)
downloadlinux-stable-d07ca3e7bab81e6981a2fc006ba6852d5653f174.tar.gz
linux-stable-d07ca3e7bab81e6981a2fc006ba6852d5653f174.tar.bz2
linux-stable-d07ca3e7bab81e6981a2fc006ba6852d5653f174.zip
mtd: lpddr: Fix bad logic in print_drs_error
commit 1c9c02bb22684f6949d2e7ddc0a3ff364fd5a6fc upstream. Update logic for broken test. Use a more common logging style. It appears the logic in this function is broken for the consecutive tests of if (prog_status & 0x3) ... else if (prog_status & 0x2) ... else (prog_status & 0x1) ... Likely the first test should be if ((prog_status & 0x3) == 0x3) Found by inspection of include files using printk. Fixes: eb3db27507f7 ("[MTD] LPDDR PFOW definition") Cc: stable@vger.kernel.org Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/3fb0e29f5b601db8be2938a01d974b00c8788501.1588016644.git.gustavo@embeddedor.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/pfow.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mtd/pfow.h b/include/linux/mtd/pfow.h
index 6166e7c60869..b8da6f8e854b 100644
--- a/include/linux/mtd/pfow.h
+++ b/include/linux/mtd/pfow.h
@@ -128,7 +128,7 @@ static inline void print_drs_error(unsigned dsr)
if (!(dsr & DSR_AVAILABLE))
printk(KERN_NOTICE"DSR.15: (0) Device not Available\n");
- if (prog_status & 0x03)
+ if ((prog_status & 0x03) == 0x03)
printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid "
"half with 41h command\n");
else if (prog_status & 0x02)