]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mtd: lpddr: Fix bad logic in print_drs_error
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 27 Apr 2020 19:50:37 +0000 (14:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Nov 2020 11:47:08 +0000 (12:47 +0100)
commitd07ca3e7bab81e6981a2fc006ba6852d5653f174
treed77b331a61f598d849b36430fe6b15f58f437e44
parent35a1d6270d451d5e7fffca87f965be5e266a7916
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>
include/linux/mtd/pfow.h