Skip to contentSkip to conversation

cdrom: remove unused variable

PATCH Applied Phillip Potter 2 participants 2 messages Apr 1, 2022

Subsystems (2)
lore
Share & tools
lore

Phillip Potter

author maintainer
#0 lore raw

PATCH 1/1 cdrom: remove unused variable

From: Enze Li <[email protected]>

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.

---
 drivers/cdrom/cdrom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/cdrom/cdrom.c +1 -2
index 7bd10d63ddbe..2dc9da683a13 100644
@@ -1365,7 +1365,6 @@ static int cdrom_slot_status(struct cdrom_device_info *cdi, int slot)
  */
 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);
Signature · 1 line
2.35.1
maintainer Applied
#1 lore raw
Quoted 10 lines · Phillip Potter

From: Enze Li <[email protected]>

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'

[...]

Applied, thanks!

[1/1] cdrom: remove unused variable

      commit: e9c1e280f2e18845d078a65378b897915d74d401

Best regards,

Signature · 1 line
Jens Axboe