From: DEEPAK VARMA <mh12gx2825@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: outreachy-kernel@googlegroups.com, daniel.baluta@gmail.com,
kieran.bingham@ideasonboard.com
Subject: Re: [PATCH 4/4] staging: fbtft: Avoid potential precedence issues
Date: Tue, 17 Mar 2020 23:49:19 +0530 [thread overview]
Message-ID: <20200317181917.GA21274@deeUbuntu> (raw)
In-Reply-To: <20200317114614.GA1233256@kroah.com>
On Tue, Mar 17, 2020 at 12:46:14PM +0100, Greg KH wrote:
> On Mon, Mar 16, 2020 at 05:12:32AM +0530, Deepak R Varma wrote:
> > Put parentheses around uses of macro parameters to avoid possible
> > precedence issues. Problem detected by checkpatch.
> >
> > Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
> > Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
> > ---
> > drivers/staging/fbtft/fbtft.h | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> > index 81da30f4062e..76f8c090a837 100644
> > --- a/drivers/staging/fbtft/fbtft.h
> > +++ b/drivers/staging/fbtft/fbtft.h
> > @@ -406,8 +406,8 @@ do { \
> >
> > #define fbtft_par_dbg(level, par, format, arg...) \
> > do { \
> > - if (unlikely(par->debug & level)) \
> > - dev_info(par->info->device, format, ##arg); \
> > + if (unlikely((par)->debug & (level))) \
> > + dev_info((par)->info->device, format, ##arg); \
>
> "precedence issues" are impossible to happen here, it's a pointer that
> we are dealing with, not some other type of expression.
>
> So I'll take this, just to shut checkpatch up, but note that this is
> _NOT_ a real issue at all.
Thank you Greg.
>
> And what about all of the other macros like this in this file? Does
> only this one need the changes?
There is one more macro that accepts arguments, but its already fixed in
the past. I did not find any other macro with similar checkpatch
warning.
>
> thanks,
>
> greg k-h
next prev parent reply other threads:[~2020-03-17 18:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-15 23:40 [PATCH v3 0/4] staging: fbtft: code cleanup patchset - checkpatch Deepak R Varma
2020-03-15 23:41 ` [PATCH 1/4] staging: fbtft: Reformat line over 80 characters Deepak R Varma
2020-03-15 23:41 ` [PATCH 2/4] staging: fbtft: Reformat long macro definitions Deepak R Varma
2020-03-15 23:42 ` [PATCH 3/4] staging: fbtft: simplify array index computation Deepak R Varma
2020-03-15 23:42 ` [PATCH 4/4] staging: fbtft: Avoid potential precedence issues Deepak R Varma
2020-03-16 13:44 ` [Outreachy kernel] " Stefano Brivio
2020-03-16 14:55 ` Deepak Varma
2020-03-17 11:46 ` Greg KH
2020-03-17 18:19 ` DEEPAK VARMA [this message]
2020-03-21 11:26 ` DEEPAK VARMA
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=20200317181917.GA21274@deeUbuntu \
--to=mh12gx2825@gmail.com \
--cc=daniel.baluta@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kieran.bingham@ideasonboard.com \
--cc=outreachy-kernel@googlegroups.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.