Skip to content

Commit 1c9c02b

Browse files
GustavoARSilvamiquelraynal
authored andcommitted
mtd: lpddr: Fix bad logic in print_drs_error
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: eb3db27 ("[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
1 parent 5610d1f commit 1c9c02b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎include/linux/mtd/pfow.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static inline void print_drs_error(unsigned dsr)
128128

129129
if (!(dsr & DSR_AVAILABLE))
130130
printk(KERN_NOTICE"DSR.15: (0) Device not Available\n");
131-
if (prog_status & 0x03)
131+
if ((prog_status & 0x03) == 0x03)
132132
printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid "
133133
"half with 41h command\n");
134134
else if (prog_status & 0x02)

0 commit comments

Comments
 (0)