[PATCH] nvme: have nvme_setup_rw return BLK_STS_OK
Vincent Fu
vincent.fu at samsung.com
Thu Apr 28 08:24:58 PDT 2022
> -----Original Message-----
> From: Christoph Hellwig [mailto:hch at infradead.org]
> Sent: Thursday, April 28, 2022 11:08 AM
> To: Vincent Fu <vincent.fu at samsung.com>
> Cc: linux-nvme at lists.infradead.org
> Subject: Re: [PATCH] nvme: have nvme_setup_rw return BLK_STS_OK
>
> On Mon, Apr 18, 2022 at 07:43:50PM +0000, Vincent Fu wrote:
> > Return BLK_STS_OK instead of 0 on success. Since BLK_STS_OK is
> defined
> > as 0 this patch results in no functional change but to avoid confusion
> > and to be consistent with nvme_setup_write_zeroes as well as
> > nvme_setup_discard we should have nvme_setup_rw also return
> BLK_STS_OK.
>
> I really don't see the point. blk_status_t like all __bitwise types
> is designed to be able to cope with a plain 0 just fine.
Thank you for the feedback. This is obviously a small cleanup but I found it
confusing that the other nvme_setup_* functions returned BLK_STS_OK whereas
nvme_setup_rw returned 0. The code is easier to understand if all of these
functions are consistent and this change saves people the trouble of making
sure that BLK_STS_OK is defined as 0.
More information about the Linux-nvme
mailing list