]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cdrom: remove unused variable
authorEnze Li <lienze@kylinos.cn>
Fri, 1 Apr 2022 21:18:42 +0000 (22:18 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 6 Apr 2022 14:47:52 +0000 (08:47 -0600)
The clang static analyzer reports the following warning,

File: drivers/cdrom/cdrom.c
Warning: line 1380, column 7
 Although the value stored to 'status' is used in enclosing
 expression, the value is never actually read from 'status'

Remove the unused variable to eliminate the warning.

Signed-off-by: Enze Li <lienze@kylinos.cn>
Link: https://lore.kernel.org/all/20220401032623.293666-1-lienze@kylinos.cn
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220401211842.2088096-1-phil@philpotter.co.uk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/cdrom/cdrom.c

index 7bd10d63ddbe5904c1e32c4cb8ec6d1647b2eb14..2dc9da683a13e30fe830aa3965b8290eb7129a53 100644 (file)
@@ -1365,7 +1365,6 @@ out_free:
  */
 int cdrom_number_of_slots(struct cdrom_device_info *cdi) 
 {
-       int status;
        int nslots = 1;
        struct cdrom_changer_info *info;
 
@@ -1377,7 +1376,7 @@ int cdrom_number_of_slots(struct cdrom_device_info *cdi)
        if (!info)
                return -ENOMEM;
 
-       if ((status = cdrom_read_mech_status(cdi, info)) == 0)
+       if (cdrom_read_mech_status(cdi, info) == 0)
                nslots = info->hdr.nslots;
 
        kfree(info);