Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvme/host: Use the enum req_op and blk_opf_t types

Improve static type checking by using the enum req_op type for variables
that represent a request operation and the new blk_opf_t type for
variables that represent request flags.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20220714180729.1065367-38-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Bart Van Assche and committed by
Jens Axboe
f9ed86dc a9010741

+3 -3
+2 -2
drivers/nvme/host/ioctl.c
··· 68 68 struct nvme_command *cmd, void __user *ubuffer, 69 69 unsigned bufflen, void __user *meta_buffer, unsigned meta_len, 70 70 u32 meta_seed, void **metap, unsigned timeout, bool vec, 71 - unsigned int rq_flags, blk_mq_req_flags_t blk_flags) 71 + blk_opf_t rq_flags, blk_mq_req_flags_t blk_flags) 72 72 { 73 73 bool write = nvme_is_write(cmd); 74 74 struct nvme_ns *ns = q->queuedata; ··· 407 407 struct nvme_uring_data d; 408 408 struct nvme_command c; 409 409 struct request *req; 410 - unsigned int rq_flags = 0; 410 + blk_opf_t rq_flags = 0; 411 411 blk_mq_req_flags_t blk_flags = 0; 412 412 void *meta = NULL; 413 413
+1 -1
drivers/nvme/host/nvme.h
··· 733 733 int nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout); 734 734 void nvme_start_freeze(struct nvme_ctrl *ctrl); 735 735 736 - static inline unsigned int nvme_req_op(struct nvme_command *cmd) 736 + static inline enum req_op nvme_req_op(struct nvme_command *cmd) 737 737 { 738 738 return nvme_is_write(cmd) ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN; 739 739 }