All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Fatih Yildirim <yildirim.fatih@gmail.com>
Cc: gustavo@embeddedor.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] staging: ks7010: Macros with complex values
Date: Thu, 11 Feb 2021 11:02:51 +0100	[thread overview]
Message-ID: <YCUAy1VhLV3lwa3H@kroah.com> (raw)
In-Reply-To: <20210211092239.10291-1-yildirim.fatih@gmail.com>

On Thu, Feb 11, 2021 at 12:22:39PM +0300, Fatih Yildirim wrote:
> Fix for checkpatch.pl warning:
> Macros with complex values should be enclosed in parentheses.
> 
> Signed-off-by: Fatih Yildirim <yildirim.fatih@gmail.com>
> ---
>  drivers/staging/ks7010/ks_hostif.h | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h
> index 39138191a556..c62a494ed6bb 100644
> --- a/drivers/staging/ks7010/ks_hostif.h
> +++ b/drivers/staging/ks7010/ks_hostif.h
> @@ -498,20 +498,20 @@ struct hostif_mic_failure_request {
>  #define TX_RATE_FIXED		5
>  
>  /* 11b rate */
> -#define TX_RATE_1M	(u8)(10 / 5)	/* 11b 11g basic rate */
> -#define TX_RATE_2M	(u8)(20 / 5)	/* 11b 11g basic rate */
> -#define TX_RATE_5M	(u8)(55 / 5)	/* 11g basic rate */
> -#define TX_RATE_11M	(u8)(110 / 5)	/* 11g basic rate */
> +#define TX_RATE_1M	((u8)(10 / 5))	/* 11b 11g basic rate */
> +#define TX_RATE_2M	((u8)(20 / 5))	/* 11b 11g basic rate */
> +#define TX_RATE_5M	((u8)(55 / 5))	/* 11g basic rate */
> +#define TX_RATE_11M	((u8)(110 / 5))	/* 11g basic rate */

But these are not "complex macros" that need an extra () added to them,
right?

Checkpatch is a hint, it's not a code parser and can not always know
what is happening.  With your knowledge of C, does this look like
something that needs to be "fixed"?

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <gregkh@linuxfoundation.org>
To: Fatih Yildirim <yildirim.fatih@gmail.com>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	gustavo@embeddedor.com
Subject: Re: [PATCH -next] staging: ks7010: Macros with complex values
Date: Thu, 11 Feb 2021 11:02:51 +0100	[thread overview]
Message-ID: <YCUAy1VhLV3lwa3H@kroah.com> (raw)
In-Reply-To: <20210211092239.10291-1-yildirim.fatih@gmail.com>

On Thu, Feb 11, 2021 at 12:22:39PM +0300, Fatih Yildirim wrote:
> Fix for checkpatch.pl warning:
> Macros with complex values should be enclosed in parentheses.
> 
> Signed-off-by: Fatih Yildirim <yildirim.fatih@gmail.com>
> ---
>  drivers/staging/ks7010/ks_hostif.h | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h
> index 39138191a556..c62a494ed6bb 100644
> --- a/drivers/staging/ks7010/ks_hostif.h
> +++ b/drivers/staging/ks7010/ks_hostif.h
> @@ -498,20 +498,20 @@ struct hostif_mic_failure_request {
>  #define TX_RATE_FIXED		5
>  
>  /* 11b rate */
> -#define TX_RATE_1M	(u8)(10 / 5)	/* 11b 11g basic rate */
> -#define TX_RATE_2M	(u8)(20 / 5)	/* 11b 11g basic rate */
> -#define TX_RATE_5M	(u8)(55 / 5)	/* 11g basic rate */
> -#define TX_RATE_11M	(u8)(110 / 5)	/* 11g basic rate */
> +#define TX_RATE_1M	((u8)(10 / 5))	/* 11b 11g basic rate */
> +#define TX_RATE_2M	((u8)(20 / 5))	/* 11b 11g basic rate */
> +#define TX_RATE_5M	((u8)(55 / 5))	/* 11g basic rate */
> +#define TX_RATE_11M	((u8)(110 / 5))	/* 11g basic rate */

But these are not "complex macros" that need an extra () added to them,
right?

Checkpatch is a hint, it's not a code parser and can not always know
what is happening.  With your knowledge of C, does this look like
something that needs to be "fixed"?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2021-02-11 10:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11  9:22 [PATCH -next] staging: ks7010: Macros with complex values Fatih Yildirim
2021-02-11  9:22 ` Fatih Yildirim
2021-02-11 10:02 ` Greg KH [this message]
2021-02-11 10:02   ` Greg KH
2021-02-11 10:57   ` Fatih YILDIRIM
2021-02-11 10:57     ` Fatih YILDIRIM
2021-02-11 11:10     ` Greg KH
2021-02-11 11:10       ` Greg KH
2021-02-11 12:23       ` Fatih Yildirim
2021-02-11 12:23         ` Fatih Yildirim
2021-02-11 12:52         ` Greg KH
2021-02-11 12:52           ` Greg KH
2021-02-11 13:29           ` Fatih YILDIRIM
2021-02-11 13:29             ` Fatih YILDIRIM

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=YCUAy1VhLV3lwa3H@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gustavo@embeddedor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yildirim.fatih@gmail.com \
    /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.