public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Cc: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Tejun Heo <tj@kernel.org>, Josef Bacik <jbacik@fb.com>,
	Mike Snitzer <snitzer@redhat.com>,
	Michael Callahan <michaelcallahan@fb.com>,
	Omar Sandoval <osandov@fb.com>,
	Mikulas Patocka <mpatocka@redhat.com>,
	Keith Busch <keith.busch@intel.com>,
	Ming Lei <ming.lei@redhat.com>,
	"Dennis Zhou (Facebook)" <dennisszhou@gmail.com>
Subject: Re: [PATCH] blk_types.h: Use REQ_OP_WRITE in op_is_write
Date: Fri, 11 Jan 2019 02:09:50 -0800	[thread overview]
Message-ID: <20190111100950.GA14142@vader> (raw)
In-Reply-To: <20181222100356.559995-1-marcos.souza.org@gmail.com>

On Sat, Dec 22, 2018 at 08:03:54AM -0200, Marcos Paulo de Souza wrote:
> Instead of just using plain '1', as it improves readability.
> 
> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.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 1dcf652ba0aa..905c666a0101 100644
> --- a/include/linux/blk_types.h
> +++ b/include/linux/blk_types.h
> @@ -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.

      parent reply	other threads:[~2019-01-11 10:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-22 10:03 [PATCH] blk_types.h: Use REQ_OP_WRITE in op_is_write Marcos Paulo de Souza
2019-01-11  2:17 ` Marcos Paulo de Souza
2019-01-11 10:09 ` Omar Sandoval [this message]

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=20190111100950.GA14142@vader \
    --to=osandov@osandov.com \
    --cc=axboe@kernel.dk \
    --cc=dennisszhou@gmail.com \
    --cc=jbacik@fb.com \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcos.souza.org@gmail.com \
    --cc=michaelcallahan@fb.com \
    --cc=ming.lei@redhat.com \
    --cc=mpatocka@redhat.com \
    --cc=osandov@fb.com \
    --cc=snitzer@redhat.com \
    --cc=tj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox