Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cdrom: remove unused variable

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>

authored by

Enze Li and committed by
Jens Axboe
4ded53ea 31231092

+1 -2
+1 -2
drivers/cdrom/cdrom.c
··· 1365 1365 */ 1366 1366 int cdrom_number_of_slots(struct cdrom_device_info *cdi) 1367 1367 { 1368 - int status; 1369 1368 int nslots = 1; 1370 1369 struct cdrom_changer_info *info; 1371 1370 ··· 1376 1377 if (!info) 1377 1378 return -ENOMEM; 1378 1379 1379 - if ((status = cdrom_read_mech_status(cdi, info)) == 0) 1380 + if (cdrom_read_mech_status(cdi, info) == 0) 1380 1381 nslots = info->hdr.nslots; 1381 1382 1382 1383 kfree(info);