summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCaleb Sander <csander@purestorage.com>2024-01-31 17:43:13 +0100
committerKeith Busch <kbusch@kernel.org>2024-02-01 01:06:12 +0100
commitf9e9115d0c014dec3278d68823eaff159f98f4d6 (patch)
treebe890680896eff32eee77c861d66785524a96a73 /include
parentnvme: remove redundant status mask (diff)
downloadlinux-f9e9115d0c014dec3278d68823eaff159f98f4d6.tar.xz
linux-f9e9115d0c014dec3278d68823eaff159f98f4d6.zip
nvme: take const cmd pointer in read-only helpers
nvme_is_fabrics() and nvme_is_write() only read struct nvme_command, so take it by const pointer. This allows callers to pass a const pointer and communicates that these functions don't modify the command. Signed-off-by: Caleb Sander <csander@purestorage.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nvme.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 68eff8c86ce3..bc605ec4a3fd 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -1812,7 +1812,7 @@ struct nvme_command {
};
};
-static inline bool nvme_is_fabrics(struct nvme_command *cmd)
+static inline bool nvme_is_fabrics(const struct nvme_command *cmd)
{
return cmd->common.opcode == nvme_fabrics_command;
}
@@ -1831,7 +1831,7 @@ struct nvme_error_slot {
__u8 resv2[24];
};
-static inline bool nvme_is_write(struct nvme_command *cmd)
+static inline bool nvme_is_write(const struct nvme_command *cmd)
{
/*
* What a mess...