[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220314150321.17720-1-lukas.bulwahn@gmail.com>
Date: Mon, 14 Mar 2022 16:03:21 +0100
From: Lukas Bulwahn <lukas.bulwahn@...il.com>
To: Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
linux-block@...r.kernel.org
Cc: "James E . J . Bottomley" <jejb@...ux.ibm.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
clang-built-linux@...glegroups.com,
kernel-janitors@...r.kernel.org,
Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: [PATCH] sr: simplify the local variable initialization in sr_block_open()
Commit 01d0c698536f ("sr: implement ->free_disk to simplify refcounting")
refactored sr_block_open(), initialized one variable with a duplicate
assignment (probably an unintended copy & paste duplication) and turned one
error case into an early return, which makes the initialization of the
return variable needless.
So, simplify the local variable initialization in sr_block_open() to make
the code a bit more clear.
No functional change. No change in resulting object code.
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@...il.com>
---
Christoph, please ack.
Jens, please pick this minor clean-up on your -next branch on top of the
commit above.
drivers/scsi/sr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 00142095522a..5ba9df334968 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -483,9 +483,9 @@ static void sr_revalidate_disk(struct scsi_cd *cd)
static int sr_block_open(struct block_device *bdev, fmode_t mode)
{
- struct scsi_cd *cd = cd = scsi_cd(bdev->bd_disk);
+ struct scsi_cd *cd = scsi_cd(bdev->bd_disk);
struct scsi_device *sdev = cd->device;
- int ret = -ENXIO;
+ int ret;
if (scsi_device_get(cd->device))
return -ENXIO;
--
2.17.1
Powered by blists - more mailing lists