Skip to contentSkip to conversation

scsi: sd: remove obsolete variable in sd_remove()

PATCH Applied Lukas Bulwahn 2 participants 2 messages Dec 14, 2020 – Jan 8, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scsi: sd: remove obsolete variable in sd_remove()

Commit 140ea3bbf39a ("sd: use __register_blkdev to avoid a modprobe for an unregistered dev_t") removed blk_register_region(devt, ...) in sd_remove() and since then, devt is unused in sd_remove().

Hence, make W=1 warns:

drivers/scsi/sd.c:3516:8:
warning: variable 'devt' set but not used [-Wunused-but-set-variable]

Simply remove this obsolete variable.

---
applies cleanly on current master and next-20201113, next-20201211

The patch was submitted for inclusion in scsi:

https://lore.kernel.org/lkml/[email protected]/

v1 -> v2:

Christoph and Nathan reviewed, and I added the tags here. Martin asked the patch to go through block.

Jens, can you please pick this minor non-urgent clean-up patch?

 drivers/scsi/sd.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/sd.c +0 -2
index 679c2c025047..21675a98620d 100644
@@ -3510,10 +3510,8 @@ static int sd_probe(struct device *dev)
 static int sd_remove(struct device *dev)
 {
 	struct scsi_disk *sdkp;
-	dev_t devt;
 
 	sdkp = dev_get_drvdata(dev);
-	devt = disk_devt(sdkp->disk);
 	scsi_autopm_get_device(sdkp->device);
 
 	async_synchronize_full_domain(&scsi_sd_pm_domain);
Signature · 1 line
2.17.1
#1 lore raw
Quoted 10 lines · Lukas Bulwahn

Commit 140ea3bbf39a ("sd: use __register_blkdev to avoid a modprobe for an unregistered dev_t") removed blk_register_region(devt, ...) in sd_remove() and since then, devt is unused in sd_remove().

Hence, make W=1 warns:

drivers/scsi/sd.c:3516:8:
warning: variable 'devt' set but not used [-Wunused-but-set-variable]

[...]

Applied to 5.11/scsi-fixes, thanks!

[1/1] scsi: sd: remove obsolete variable in sd_remove()

      https://git.kernel.org/mkp/scsi/c/be2553358cd4
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering