Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH v2] staging: rtl8712: efuse: code style - avoid macro argument precedence issues
@ 2022-04-12  6:14 aliya-rahmani
  2022-04-12  6:26 ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: aliya-rahmani @ 2022-04-12  6:14 UTC (permalink / raw)
  To: florian.c.schilhabel; +Cc: gregkh, linux-staging, outreachy, Aliya Rahmani

From: Aliya Rahmani <aliyarahmani786@gmail.com>

This patch fixes checkpatch warnings of precedence issues. Added parentheses
around macro arguments 'offset' and 'word_en'.

Signed-off-by: Aliya Rahmani <aliyarahmani786@gmail.com>
---
v1 -> v2: Updated the description of the fixes.
---

 drivers/staging/rtl8712/rtl8712_efuse.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_efuse.h b/drivers/staging/rtl8712/rtl8712_efuse.h
index 4969d307e978..2e1ea9d7a295 100644
--- a/drivers/staging/rtl8712/rtl8712_efuse.h
+++ b/drivers/staging/rtl8712/rtl8712_efuse.h
@@ -15,8 +15,8 @@
 
 #define GET_EFUSE_OFFSET(header)	((header & 0xF0) >> 4)
 #define GET_EFUSE_WORD_EN(header)	(header & 0x0F)
-#define MAKE_EFUSE_HEADER(offset, word_en)	(((offset & 0x0F) << 4) | \
-						(word_en & 0x0F))
+#define MAKE_EFUSE_HEADER(offset, word_en)	((((offset) & 0x0F) << 4) | \
+						((word_en) & 0x0F))
 /*--------------------------------------------------------------------------*/
 struct PGPKT_STRUCT {
 	u8 offset;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* Re: [PATCH] staging: rtl8712: efuse: code style - avoid macro argument precedence issues
@ 2022-04-11  6:47 Julia Lawall
  2022-04-11 11:02 ` [PATCH v2] " aliya-rahmani
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2022-04-11  6:47 UTC (permalink / raw)
  To: aliya-rahmani; +Cc: outreachy, florian.c.schilhabel, gregkh, linux-staging



On Mon, 11 Apr 2022, aliya-rahmani wrote:

> This patch fixes the following checkpatch.pl check:
>  CHECK: Macro argument 'offset' and 'word_en' may be better as '(offset)' and 'word_en' to avoid precedence issues

Your messages say "avoid" and "fix", but they don't explicitly say what
you do.

>
> Signed-off-by: aliya-rahmani <aliyarahmani786@gmail.com>

This could be better as:

Aliya Rahmani <aliyarahmani786@gmail.com>

julia

> ---
>  drivers/staging/rtl8712/rtl8712_efuse.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/rtl8712_efuse.h b/drivers/staging/rtl8712/rtl8712_efuse.h
> index 4969d307e978..2e1ea9d7a295 100644
> --- a/drivers/staging/rtl8712/rtl8712_efuse.h
> +++ b/drivers/staging/rtl8712/rtl8712_efuse.h
> @@ -15,8 +15,8 @@
>
>  #define GET_EFUSE_OFFSET(header)	((header & 0xF0) >> 4)
>  #define GET_EFUSE_WORD_EN(header)	(header & 0x0F)
> -#define MAKE_EFUSE_HEADER(offset, word_en)	(((offset & 0x0F) << 4) | \
> -						(word_en & 0x0F))
> +#define MAKE_EFUSE_HEADER(offset, word_en)	((((offset) & 0x0F) << 4) | \
> +						((word_en) & 0x0F))
>  /*--------------------------------------------------------------------------*/
>  struct PGPKT_STRUCT {
>  	u8 offset;
> --
> 2.25.1
>
>
>

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

end of thread, other threads:[~2022-04-12  6:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-12  6:14 [PATCH v2] staging: rtl8712: efuse: code style - avoid macro argument precedence issues aliya-rahmani
2022-04-12  6:26 ` Julia Lawall
  -- strict thread matches above, loose matches on Subject: below --
2022-04-11  6:47 [PATCH] " Julia Lawall
2022-04-11 11:02 ` [PATCH v2] " aliya-rahmani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox