From: Greg KH <gregkh@linuxfoundation.org>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH] staging: sm750fb: Enclose macro arguments in parentheses
Date: Tue, 07 Feb 2017 19:48:37 +0000 [thread overview]
Message-ID: <20170207194837.GA17813@kroah.com> (raw)
In-Reply-To: <ca24586f16d0a9ff4d5882156e358600e94fd71c.1486493982.git.gmatthsim@gmail.com>
On Tue, Feb 07, 2017 at 11:11:22AM -0800, Matthieu Simon wrote:
> checkpatch noticed possible precedence issues resulting in the definition
> of PEEK32 and POKE32. So, these arguments should be enclosed in
> parentheses.
>
> Signed-off-by: Matthieu Simon <gmatthsim@gmail.com>
> ---
> drivers/staging/sm750fb/ddk750_chip.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
> index e63b8b293816..a5f910344373 100644
> --- a/drivers/staging/sm750fb/ddk750_chip.h
> +++ b/drivers/staging/sm750fb/ddk750_chip.h
> @@ -10,8 +10,8 @@
> #include <linux/uaccess.h>
>
> /* software control endianness */
> -#define PEEK32(addr) readl(addr + mmio750)
> -#define POKE32(addr, data) writel(data, addr + mmio750)
> +#define PEEK32(addr) readl((addr) + mmio750)
> +#define POKE32(addr, data) writel((data), (addr) + mmio750)
Those are funny macros, how about just making them an inline function so
that we get the correct type-checking and better documentation as to
what is going on with them?
thanks,
greg k-h
prev parent reply other threads:[~2017-02-07 19:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-07 19:11 [PATCH] staging: sm750fb: Enclose macro arguments in parentheses Matthieu Simon
2017-02-07 19:48 ` Greg KH [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=20170207194837.GA17813@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.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 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.