[PATCH] block: use enumerate instead of integer in op_is_write()

From: brookxu
Date: Thu Aug 19 2021 - 21:55:18 EST


From: Chunguang Xu <brookxu@xxxxxxxxxxx>

For mask operation, using enumerate may be safer than integer.

Signed-off-by: Chunguang Xu <brookxu@xxxxxxxxxxx>
---
include/linux/blk_types.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index fd3860d1..b0411dc 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -447,7 +447,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);
}

/*
--
1.8.3.1