]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: rawnand: silence static checker warning in nand_setup_interface()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 20 Apr 2021 08:44:51 +0000 (11:44 +0300)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 10 May 2021 09:54:07 +0000 (11:54 +0200)
commita8ce3e3eb44faee5c1907bb8629027b674421d9f
treeaa158eba9c175277d612c08e7650f1639c137e6b
parent6164c78a3a1c4d0262e802fd963be2cce56c00f0
mtd: rawnand: silence static checker warning in nand_setup_interface()

Smatch complains that the error code is not set on this error path:

    drivers/mtd/nand/raw/nand_base.c:842 nand_setup_interface()
    warn: missing error code 'ret'

But actually returning success is intentional because the NAND chip will
still work in mode 0.  This patch adds a "ret = 0;" assignment to make
the intent more clear and to silence the static checker warning.  It
doesn't affect the compiled code because GCC optimises the assignment
away.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/YH6Ugwz3gcga+q8X@mwanda
drivers/mtd/nand/raw/nand_base.c