blk_types.h: Use REQ_OP_WRITE in op_is_write
PATCH 1/1 blk_types.h: Use REQ_OP_WRITE in op_is_write
Instead of just using plain '1', as it improves readability.
Signed-off-by Marcos Paulo de Souza <[email protected]>
--- include/linux/blk_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/blk_types.h +1 -1
@@ -377,7 +377,7 @@ static inline void bio_set_op_attrs(struct bio *bio, unsigned op,static inline bool op_is_write (unsigned int op) { -return (op &1 ); +return (op &REQ_OP_WRITE ); }/*
Signature · 1 line
2.16.4
ping?
Quoted 23 lines · Marcos Paulo de Souza
Instead of just using plain '1', as it improves readability.
Signed-off-by Marcos Paulo de Souza <[email protected]>--- include/linux/blk_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/blk_types.h +1
-1@@ -377,7 +377,7 @@ static inline void bio_set_op_attrs(struct bio *bio, unsigned op,static inline bool op_is_write (unsigned int op) { -return (op &1 ); +return (op &REQ_OP_WRITE ); }/* Signature · 1 line
2.16.4
Signature · 2 lines
Thanks, Marcos
Quoted 12 lines · Marcos Paulo de Souza
Instead of just using plain '1', as it improves readability.
Signed-off-by Marcos Paulo de Souza <[email protected]>--- include/linux/blk_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/blk_types.h +0
-0
include/linux/blk_types.h static inline void bio_set_op_attrs(struct bio *bio, unsigned op, · line 383
Quoted 8 lines
include/linux/blk_types.h +1
-1@@ -377,7 +377,7 @@ static inline void bio_set_op_attrs(struct bio *bio, unsigned op,static inline bool op_is_write (unsigned int op) { -return (op &1 ); +return (op &REQ_OP_WRITE ); }/*
Nak. Conceptually, an operation is a write if the least significant bit is set. The 1 here doesn't mean REQ_OP_WRITE, it means the least significant bit.