On Fri, Jun 17, 2022 at 11:25:41AM -0700, Bart Van Assche wrote: > I looked into adding a __bitwise annotation for request flags by > introducing a new type that is called blk_mq_opf_t. Introducing such a type > without modifying a lot of code seems difficult to me. This is what I ran > into: > * If the type of the operation type constants (REQ_OP_READ etc.) is > modified into blk_mq_opf_t then their type changes from 'enum req_opf' into > type blk_mq_opf_t and sparse complains when passing e.g. REQ_OP_READ to a > function that accepts an argument with type enum req_opf. > * If the type of the operation type constants is not modified then sparse > complains about bitwise or-ing the operation type and a request flag, e.g. > REQ_OP_WRITE | REQ_FUA. > > I'm not sure how to solve this other than by modifying the functions that > accept an 'opf' argument into accepting an additional argument (enum > req_opf op + blk_mq_opf_t op_flags). I actually always though of one type for the operation plus flags as we basically always use the together. That might still run into a lot of problems, but is definitively way simpler and matches how all the argument passing actually works.