[PATCH] nvmet: don't open-code NVME_NS_ATTR_RO enumeration
Sagi Grimberg
sagi at grimberg.me
Wed Dec 7 03:28:23 PST 2022
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));
--
2.34.1
More information about the Linux-nvme
mailing list