* [PATCH] block: Remove redundant initialization of variable ret
@ 2021-11-26 23:06 Colin Ian King
2021-11-27 16:08 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2021-11-26 23:06 UTC (permalink / raw)
To: Jens Axboe, linux-block; +Cc: kernel-janitors, linux-kernel
The variable ret is being initialized with a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
block/bdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/bdev.c b/block/bdev.c
index 886a08a045a6..26eefa5de6ca 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -665,7 +665,7 @@ static void blkdev_flush_mapping(struct block_device *bdev)
static int blkdev_get_whole(struct block_device *bdev, fmode_t mode)
{
struct gendisk *disk = bdev->bd_disk;
- int ret = 0;
+ int ret;
if (disk->fops->open) {
ret = disk->fops->open(bdev, mode);
--
2.33.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] block: Remove redundant initialization of variable ret
2021-11-26 23:06 [PATCH] block: Remove redundant initialization of variable ret Colin Ian King
@ 2021-11-27 16:08 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-11-27 16:08 UTC (permalink / raw)
To: linux-block, Colin Ian King; +Cc: kernel-janitors, linux-kernel
On Fri, 26 Nov 2021 23:06:52 +0000, Colin Ian King wrote:
> The variable ret is being initialized with a value that is never
> read, it is being updated later on. The assignment is redundant and
> can be removed.
>
>
Applied, thanks!
[1/1] block: Remove redundant initialization of variable ret
commit: a77f46727daa3febf99663ab1a43c86cf3c2b957
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-27 16:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26 23:06 [PATCH] block: Remove redundant initialization of variable ret Colin Ian King
2021-11-27 16:08 ` Jens Axboe
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).