diff mbox series

block: Remove redundant initialization of variable ret

Message ID 20211126230652.1175636-1-colin.i.king@gmail.com (mailing list archive)
State New, archived
Headers show
Series block: Remove redundant initialization of variable ret | expand

Commit Message

Colin Ian King Nov. 26, 2021, 11:06 p.m. UTC
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(-)

Comments

Jens Axboe Nov. 27, 2021, 4:08 p.m. UTC | #1
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,
diff mbox series

Patch

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);