All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: axboe@kernel.dk, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Bean Huo <beanhuo@micron.com>
Subject: [PATCH] block: Use REQ_OP_WRITE instead of its integer constant 1 in op_is_write()
Date: Mon, 15 Nov 2021 22:58:19 +0100	[thread overview]
Message-ID: <20211115215819.28787-1-huobean@gmail.com> (raw)

From: Bean Huo <beanhuo@micron.com>

Use the enums REQ_OP_WRITE in op_is_write() to make it less maintenance
requirement and more readable

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 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 fe065c394fff..5b5924a7e754 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -463,7 +463,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);
 }
 
 /*
-- 
2.25.1


             reply	other threads:[~2021-11-15 22:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 21:58 Bean Huo [this message]
2021-11-15 23:48 ` [PATCH] block: Use REQ_OP_WRITE instead of its integer constant 1 in op_is_write() Damien Le Moal
2021-11-16  2:38   ` Keith Busch
2021-11-16  1:30 ` Chaitanya Kulkarni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211115215819.28787-1-huobean@gmail.com \
    --to=huobean@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=beanhuo@micron.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.