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

David Regan dregan at broadcom.com
Mon Dec 4 10:45:08 PST 2023


On Sun, Dec 3, 2023 at 11:41 PM Dan Carpenter <dan.carpenter at linaro.org> wrote:
>
> 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 }

Hi Dan, thank you for catching this. I have to make some changes to
this file and will add in a fix for this issue.

>
> regards,
> dan carpenter

-Dave



More information about the linux-mtd mailing list