linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blk_types.h: Use REQ_OP_WRITE in op_is_write
@ 2018-12-22 10:03 Marcos Paulo de Souza
  2019-01-11  2:17 ` Marcos Paulo de Souza
  2019-01-11 10:09 ` Omar Sandoval
  0 siblings, 2 replies; 3+ messages in thread
From: Marcos Paulo de Souza @ 2018-12-22 10:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Marcos Paulo de Souza, Jens Axboe, Tejun Heo, Josef Bacik,
	Mike Snitzer, Michael Callahan, Omar Sandoval, Mikulas Patocka,
	Keith Busch, Ming Lei, Dennis Zhou (Facebook)

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);
 }
 
 /*
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] blk_types.h: Use REQ_OP_WRITE in op_is_write
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Marcos Paulo de Souza @ 2019-01-11  2:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jens Axboe, Tejun Heo, Josef Bacik, Mike Snitzer,
	Michael Callahan, Omar Sandoval, Mikulas Patocka, Keith Busch,
	Ming Lei, Dennis Zhou (Facebook)

ping?

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);
>  }
>  
>  /*
> -- 
> 2.16.4
> 

-- 
Thanks,
Marcos

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] blk_types.h: Use REQ_OP_WRITE in op_is_write
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Omar Sandoval @ 2019-01-11 10:09 UTC (permalink / raw)
  To: Marcos Paulo de Souza
  Cc: linux-kernel, Jens Axboe, Tejun Heo, Josef Bacik, Mike Snitzer,
	Michael Callahan, Omar Sandoval, Mikulas Patocka, Keith Busch,
	Ming Lei, Dennis Zhou (Facebook)

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-11 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).