]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
mtd: tests: Remove redundant assignment to err
authorYang Li <yang.lee@linux.alibaba.com>
Wed, 28 Apr 2021 10:02:22 +0000 (18:02 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 10 May 2021 10:48:35 +0000 (12:48 +0200)
Variable 'err' is set to 0 but this value is never read as it is
overwritten with a new value later on, hence it is a redundant
assignment and can be removed.

Cleans up the following clang-analyzer warning:

drivers/mtd/tests/torturetest.c:233:2: warning: Value stored to 'err' is
never read [clang-analyzer-deadcode.DeadStores]

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/1619604142-119891-1-git-send-email-yang.lee@linux.alibaba.com
drivers/mtd/tests/torturetest.c

index 6787ac5471a94722a63b0b9a95244e9abcfb438d..841689b4d86d24d8c8fe3a9b3aa13e0ca401fdfa 100644 (file)
@@ -230,8 +230,6 @@ static int __init tort_init(void)
        if (!bad_ebs)
                goto out_check_buf;
 
-       err = 0;
-
        /* Initialize patterns */
        memset(patt_FF, 0xFF, mtd->erasesize);
        for (i = 0; i < mtd->erasesize / pgsize; i++) {