* [PATCH v2] scsi: sd: remove obsolete variable in sd_remove()
@ 2020-12-14 9:54 Lukas Bulwahn
2021-01-08 4:19 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Lukas Bulwahn @ 2020-12-14 9:54 UTC (permalink / raw)
To: Jens Axboe, linux-block
Cc: Christoph Hellwig, Martin K . Petersen, linux-scsi,
Nathan Chancellor, clang-built-linux, kernel-janitors,
linux-kernel, 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]
Simply remove this obsolete variable.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
applies cleanly on current master and next-20201113, next-20201211
The patch was submitted for inclusion in scsi:
https://lore.kernel.org/lkml/20201116070035.11870-1-lukas.bulwahn@gmail.com/
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(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 679c2c025047..21675a98620d 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -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);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] scsi: sd: remove obsolete variable in sd_remove()
2020-12-14 9:54 [PATCH v2] scsi: sd: remove obsolete variable in sd_remove() Lukas Bulwahn
@ 2021-01-08 4:19 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2021-01-08 4:19 UTC (permalink / raw)
To: Lukas Bulwahn, linux-block, Jens Axboe
Cc: Martin K . Petersen, Christoph Hellwig, linux-kernel, linux-scsi,
Nathan Chancellor, clang-built-linux, kernel-janitors
On Mon, 14 Dec 2020 10:54:24 +0100, Lukas Bulwahn wrote:
> 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
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-08 4:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 9:54 [PATCH v2] scsi: sd: remove obsolete variable in sd_remove() Lukas Bulwahn
2021-01-08 4:19 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).