[PATCH] nvmet: don't open-code NVME_NS_ATTR_RO enumeration
Chaitanya Kulkarni
chaitanyak at nvidia.com
Wed Dec 7 10:25:53 PST 2022
On 12/7/22 03:28, Sagi Grimberg wrote:
> It is already there, just go ahead and use it.
>
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
> drivers/nvme/target/admin-cmd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
> index 6b46f90a63cf..53a004ea320c 100644
> --- a/drivers/nvme/target/admin-cmd.c
> +++ b/drivers/nvme/target/admin-cmd.c
> @@ -561,7 +561,7 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req)
> }
>
> if (req->ns->readonly)
> - id->nsattr |= (1 << 0);
> + id->nsattr |= NVME_NS_ATTR_RO;
> done:
> if (!status)
> status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id));
Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>
-ck
More information about the Linux-nvme
mailing list