mtd: block2mtd: remove redundant initialization of 'bdev'
authorColin Ian King <colin.king@canonical.com>
Sat, 20 Jan 2018 22:09:34 +0000 (22:09 +0000)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Thu, 15 Mar 2018 16:15:34 +0000 (17:15 +0100)
Pointer bdev is being initialized however this value is never
read as bdev is assigned an updated value from the returned
call to blkdev_get_by_path.  Remove the redundant assignment.

Cleans up clang warning:
drivers/mtd/devices/block2mtd.c:228:23: warning: Value stored to
'bdev' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/mtd/devices/block2mtd.c

index 62fd6905c648c6eb5ef167e019831729bb294a85..bb0734600a07ed82f384b1dbc8569a17bc7ad817 100644 (file)
@@ -225,7 +225,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size,
        int i;
 #endif
        const fmode_t mode = FMODE_READ | FMODE_WRITE | FMODE_EXCL;
-       struct block_device *bdev = ERR_PTR(-ENODEV);
+       struct block_device *bdev;
        struct block2mtd_dev *dev;
        char *name;