* [PATCH] blk-zoned: Remove unnecessary ‘0’ values from ret
@ 2024-03-18 2:55 Li zeming
2024-03-19 3:05 ` Chaitanya Kulkarni
2024-05-28 9:22 ` Markus Elfring
0 siblings, 2 replies; 3+ messages in thread
From: Li zeming @ 2024-03-18 2:55 UTC (permalink / raw)
To: axboe; +Cc: linux-block, linux-kernel, Li zeming
ret is assigned first, so it does not need to initialize the assignment.
Signed-off-by: Li zeming <zeming@nfschina.com>
---
block/blk-zoned.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index d343e5756a9c8..6633e95bc7858 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -255,7 +255,7 @@ int blkdev_zone_mgmt(struct block_device *bdev, enum req_op op,
sector_t capacity = bdev_nr_sectors(bdev);
sector_t end_sector = sector + nr_sectors;
struct bio *bio = NULL;
- int ret = 0;
+ int ret;
if (!bdev_is_zoned(bdev))
return -EOPNOTSUPP;
--
2.18.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] blk-zoned: Remove unnecessary ‘0’ values from ret
2024-03-18 2:55 [PATCH] blk-zoned: Remove unnecessary ‘0’ values from ret Li zeming
@ 2024-03-19 3:05 ` Chaitanya Kulkarni
2024-05-28 9:22 ` Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2024-03-19 3:05 UTC (permalink / raw)
To: Li zeming, axboe; +Cc: linux-block, linux-kernel
On 3/17/24 19:55, Li zeming wrote:
> ret is assigned first, so it does not need to initialize the assignment.
>
> Signed-off-by: Li zeming <zeming@nfschina.com>
> ---
>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] blk-zoned: Remove unnecessary ‘0’ values from ret
2024-03-18 2:55 [PATCH] blk-zoned: Remove unnecessary ‘0’ values from ret Li zeming
2024-03-19 3:05 ` Chaitanya Kulkarni
@ 2024-05-28 9:22 ` Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2024-05-28 9:22 UTC (permalink / raw)
To: Li zeming, linux-block, Chaitanya Kulkarni, Jens Axboe; +Cc: LKML
> ret is assigned first, so it does not need to initialize the assignment.
* Would a wording approach (like the following) be a bit nicer?
The variable “ret” will eventually be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.
* How do you think about to use the summary phrase
“Delete an unnecessary initialisation in blkdev_zone_mgmt()”?
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-28 9:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-18 2:55 [PATCH] blk-zoned: Remove unnecessary ‘0’ values from ret Li zeming
2024-03-19 3:05 ` Chaitanya Kulkarni
2024-05-28 9:22 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®