All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitfield: suggest using bitwise OR when combining bitfields
@ 2023-05-23 12:16 Peter Rosin
  2023-05-23 15:33 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Rosin @ 2023-05-23 12:16 UTC (permalink / raw)
  To: LKML; +Cc: Jakub Kicinski, Dinan Gunawardena, Kalle Valo, Johannes Berg

Logical OR fails to deliver the desired result. Most of the time.

Fixes: 3e9b3112ec74 ("add basic register-field manipulation macros")
Fixes: e2192de59e45 ("bitfield: add FIELD_PREP_CONST()")
Signed-off-by: Peter Rosin <peda@axentia.se>
---
 include/linux/bitfield.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h
index ebfa12f69501..d70fc96585e2 100644
--- a/include/linux/bitfield.h
+++ b/include/linux/bitfield.h
@@ -107,7 +107,7 @@
  * @_val:  value to put in the field
  *
  * FIELD_PREP() masks and shifts up the value.  The result should
- * be combined with other fields of the bitfield using logical OR.
+ * be combined with other fields of the bitfield using bitwise OR.
  */
 #define FIELD_PREP(_mask, _val)						\
 	({								\
@@ -123,7 +123,7 @@
  * @_val:  value to put in the field
  *
  * FIELD_PREP_CONST() masks and shifts up the value.  The result should
- * be combined with other fields of the bitfield using logical OR.
+ * be combined with other fields of the bitfield using bitwise OR.
  *
  * Unlike FIELD_PREP() this is a constant expression and can therefore
  * be used in initializers. Error checking is less comfortable for this
-- 
2.20.1



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

* Re: [PATCH] bitfield: suggest using bitwise OR when combining bitfields
  2023-05-23 12:16 [PATCH] bitfield: suggest using bitwise OR when combining bitfields Peter Rosin
@ 2023-05-23 15:33 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2023-05-23 15:33 UTC (permalink / raw)
  To: Peter Rosin; +Cc: LKML, Dinan Gunawardena, Kalle Valo, Johannes Berg

On Tue, 23 May 2023 14:16:30 +0200 Peter Rosin wrote:
> Logical OR fails to deliver the desired result. Most of the time.
> 
> Fixes: 3e9b3112ec74 ("add basic register-field manipulation macros")
> Fixes: e2192de59e45 ("bitfield: add FIELD_PREP_CONST()")

Fixes tags for comment changes are an overkill. The change looks good.

Who are you expecting to take this patch? Feel free to repost this
CCing netdev@ so networking can take it, otherwise maybe Andrew will?
Not sure..

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

end of thread, other threads:[~2023-05-23 15:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-23 12:16 [PATCH] bitfield: suggest using bitwise OR when combining bitfields Peter Rosin
2023-05-23 15:33 ` Jakub Kicinski

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.