Commit f9e9115d authored by Caleb Sander's avatar Caleb Sander Committed by Keith Busch
Browse files

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: default avatarCaleb Sander <csander@purestorage.com>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 6f9a71c6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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...