public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] nvmet: don't open-code NVME_NS_ATTR_RO enumeration
@ 2022-12-07 11:28 Sagi Grimberg
  2022-12-07 14:04 ` Christoph Hellwig
  2022-12-07 18:25 ` Chaitanya Kulkarni
  0 siblings, 2 replies; 3+ messages in thread
From: Sagi Grimberg @ 2022-12-07 11:28 UTC (permalink / raw)
  To: linux-nvme; +Cc: Christoph Hellwig, Chaitanya Kulkarni, Keith Busch

It is already there, just go ahead and use it.

Signed-off-by: Sagi Grimberg <sagi@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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-07 18:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-07 11:28 [PATCH] nvmet: don't open-code NVME_NS_ATTR_RO enumeration Sagi Grimberg
2022-12-07 14:04 ` Christoph Hellwig
2022-12-07 18:25 ` Chaitanya Kulkarni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox