[bug report] mtd: rawnand: brcmnand: exec_op implementation

Dan Carpenter dan.carpenter at linaro.org
Sun Dec 3 23:41:08 PST 2023


Hello David Regan,

The patch 3cc4718fa644: "mtd: rawnand: brcmnand: exec_op
implementation" from Nov 24, 2023 (linux-next), leads to the
following Smatch static checker warning:

drivers/mtd/nand/raw/brcmnand/brcmnand.c:1701 brcmnand_status() warn: signedness bug returning '(-110)'
drivers/mtd/nand/raw/brcmnand/brcmnand.c:1710 brcmnand_reset() warn: signedness bug returning '(-110)'

drivers/mtd/nand/raw/brcmnand/brcmnand.c
    1693 static u8 brcmnand_status(struct brcmnand_host *host)
    1694 {
    1695         struct nand_chip *chip = &host->chip;
    1696         struct mtd_info *mtd = nand_to_mtd(chip);
    1697 
    1698         brcmnand_set_cmd_addr(mtd, 0);
    1699         brcmnand_send_cmd(host, CMD_STATUS_READ);
    1700 
--> 1701         return brcmnand_waitfunc(chip);

brcmnand_waitfunc() returns negative error codes but we truncate it to
a u8.

    1702 }

regards,
dan carpenter



More information about the linux-mtd mailing list