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

block/rnbd: Use blk_opf_t where appropriate

Improve static type checking by using the new blk_opf_t type to represent
the combination of a request and request flags.

Acked-by: Jack Wang <jinpu.wang@ionos.com>
Cc: Md. Haris Iqbal <haris.iqbal@ionos.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20220714180729.1065367-17-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Bart Van Assche and committed by
Jens Axboe
03df83ac 23f8ae71

+4 -3
+4 -3
drivers/block/rnbd/rnbd-proto.h
··· 229 229 return true; 230 230 } 231 231 232 - static inline u32 rnbd_to_bio_flags(u32 rnbd_opf) 232 + static inline blk_opf_t rnbd_to_bio_flags(u32 rnbd_opf) 233 233 { 234 - u32 bio_opf; 234 + blk_opf_t bio_opf; 235 235 236 236 switch (rnbd_op(rnbd_opf)) { 237 237 case RNBD_OP_READ: ··· 286 286 break; 287 287 default: 288 288 WARN(1, "Unknown request type %d (flags %llu)\n", 289 - req_op(rq), (unsigned long long)rq->cmd_flags); 289 + (__force u32)req_op(rq), 290 + (__force unsigned long long)rq->cmd_flags); 290 291 rnbd_opf = 0; 291 292 } 292 293