linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: sd: remove obsolete variable in sd_remove()
@ 2020-11-16  7:00 Lukas Bulwahn
  2020-11-16  8:28 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Lukas Bulwahn @ 2020-11-16  7:00 UTC (permalink / raw)
  To: Christoph Hellwig, Hannes Reinecke, Martin K . Petersen,
	James E . J . Bottomley, linux-scsi
  Cc: Arnd Bergmann, Tom Rix, Nathan Chancellor, Nick Desaulniers,
	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.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
applies cleanly on current master and next-20201113

Christoph, Hannes, please ack.

Martin, James, 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 106a9cda0eb7..82d0cb97b758 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3513,10 +3513,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] 5+ messages in thread

* Re: [PATCH] scsi: sd: remove obsolete variable in sd_remove()
  2020-11-16  7:00 [PATCH] scsi: sd: remove obsolete variable in sd_remove() Lukas Bulwahn
@ 2020-11-16  8:28 ` Christoph Hellwig
  2020-11-17  1:55 ` Nathan Chancellor
  2020-11-17  3:54 ` Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2020-11-16  8:28 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Christoph Hellwig, Hannes Reinecke, Martin K . Petersen,
	James E . J . Bottomley, linux-scsi, Arnd Bergmann, Tom Rix,
	Nathan Chancellor, Nick Desaulniers, clang-built-linux,
	kernel-janitors, linux-kernel

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: sd: remove obsolete variable in sd_remove()
  2020-11-16  7:00 [PATCH] scsi: sd: remove obsolete variable in sd_remove() Lukas Bulwahn
  2020-11-16  8:28 ` Christoph Hellwig
@ 2020-11-17  1:55 ` Nathan Chancellor
  2020-11-17  3:54 ` Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Nathan Chancellor @ 2020-11-17  1:55 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Christoph Hellwig, Hannes Reinecke, Martin K . Petersen,
	James E . J . Bottomley, linux-scsi, Arnd Bergmann, Tom Rix,
	Nick Desaulniers, clang-built-linux, kernel-janitors,
	linux-kernel

On Mon, Nov 16, 2020 at 08:00:35AM +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]
> 
> Simply remove this obsolete variable.
> 
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: sd: remove obsolete variable in sd_remove()
  2020-11-16  7:00 [PATCH] scsi: sd: remove obsolete variable in sd_remove() Lukas Bulwahn
  2020-11-16  8:28 ` Christoph Hellwig
  2020-11-17  1:55 ` Nathan Chancellor
@ 2020-11-17  3:54 ` Martin K. Petersen
  2020-11-17  3:58   ` Martin K. Petersen
  2 siblings, 1 reply; 5+ messages in thread
From: Martin K. Petersen @ 2020-11-17  3:54 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Christoph Hellwig, Hannes Reinecke, Martin K . Petersen,
	James E . J . Bottomley, linux-scsi, Arnd Bergmann, Tom Rix,
	Nathan Chancellor, Nick Desaulniers, clang-built-linux,
	kernel-janitors, linux-kernel


Lukas,

> 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().

Applied to 5.11/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: sd: remove obsolete variable in sd_remove()
  2020-11-17  3:54 ` Martin K. Petersen
@ 2020-11-17  3:58   ` Martin K. Petersen
  0 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2020-11-17  3:58 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Christoph Hellwig, Hannes Reinecke, James E . J . Bottomley,
	linux-scsi, Arnd Bergmann, Tom Rix, Nathan Chancellor,
	Nick Desaulniers, clang-built-linux, kernel-janitors,
	linux-kernel


>> 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().
>
> Applied to 5.11/scsi-staging, thanks!

Actually, this should go through block given the dependency on the
commit above.

Acked-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-17  3:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16  7:00 [PATCH] scsi: sd: remove obsolete variable in sd_remove() Lukas Bulwahn
2020-11-16  8:28 ` Christoph Hellwig
2020-11-17  1:55 ` Nathan Chancellor
2020-11-17  3:54 ` Martin K. Petersen
2020-11-17  3:58   ` 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).