diff mbox series

[v2,1/7] block: Use BLK_STS_OK in bio_init()

Message ID 20241028152730.3377030-2-john.g.garry@oracle.com (mailing list archive)
State New
Headers show
Series bio_split() error handling rework | expand

Commit Message

John Garry Oct. 28, 2024, 3:27 p.m. UTC
Use the proper blk_status_t value to init the bi_status.

Signed-off-by: John Garry <john.g.garry@oracle.com>
---
 block/bio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig Oct. 28, 2024, 4:11 p.m. UTC | #1
On Mon, Oct 28, 2024 at 03:27:24PM +0000, John Garry wrote:
> Use the proper blk_status_t value to init the bi_status.

I think 0 as ok is a very wide spread assumption and intentional.
Personally I think 0 is fine, as it also is special case by
__bitwise types, but if Jens prefers it this way I'm fine with that
too.
John Garry Oct. 28, 2024, 4:32 p.m. UTC | #2
On 28/10/2024 16:11, Christoph Hellwig wrote:
> On Mon, Oct 28, 2024 at 03:27:24PM +0000, John Garry wrote:
>> Use the proper blk_status_t value to init the bi_status.
> I think 0 as ok is a very wide spread assumption and intentional.

Sure

> Personally I think 0 is fine, as it also is special case by
> __bitwise types, but if Jens prefers it this way I'm fine with that
> too.

I just found it easier to grep BLK_STS_OK (rather than 0). And also 
proper to init to the declared macro, but I don't feel strongly about this.

Cheers
diff mbox series

Patch

diff --git a/block/bio.c b/block/bio.c
index 95e2ee14cea2..4cc33ee68640 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -251,7 +251,7 @@  void bio_init(struct bio *bio, struct block_device *bdev, struct bio_vec *table,
 	bio->bi_flags = 0;
 	bio->bi_ioprio = 0;
 	bio->bi_write_hint = 0;
-	bio->bi_status = 0;
+	bio->bi_status = BLK_STS_OK;
 	bio->bi_iter.bi_sector = 0;
 	bio->bi_iter.bi_size = 0;
 	bio->bi_iter.bi_idx = 0;