mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Joe Perches <joe@perches.com>
Cc: Harman Kalra <harman4linux@gmail.com>,
	thomas.petazzoni@free-electrons.com, noralf@tronnes.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging : fbtft: Removed "line over 80 characters" Warnings
Date: Sun, 2 Oct 2016 17:15:44 +0200	[thread overview]
Message-ID: <20161002151543.GA12676@kroah.com> (raw)
In-Reply-To: <1475098057.2685.15.camel@perches.com>

On Wed, Sep 28, 2016 at 02:27:37PM -0700, Joe Perches wrote:
> On Thu, 2016-09-29 at 02:01 +0530, Harman Kalra wrote:
> > Removed "line over 80 characters" Warnings using checkpatch.pl
> []
> > diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> []
> > @@ -402,7 +407,9 @@ static void __exit fbtft_driver_module_exit(void)                          \
> >  #define fbtft_init_dbg(dev, format, arg...)                  \
> >  do {                                                         \
> >  	if (unlikely((dev)->platform_data &&                 \
> > -	    (((struct fbtft_platform_data *)(dev)->platform_data)->display.debug & DEBUG_DRIVER_INIT_FUNCTIONS))) \
> > +	    (((struct fbtft_platform_data *) \
> > +		(dev)->platform_data)->display.debug \
> > +		& DEBUG_DRIVER_INIT_FUNCTIONS))) \
> >  		dev_info(dev, format, ##arg);                \
> >  } while (0)
> 
> A nicer way to do might be a statement expression macro
> 
> #define fbtft_init_dbg(dev, format, ...)				\
> ({									\
> 	struct fbtft_platform_data *pdata;				\
> 	pdata = (struct fbtft_platform_data *)((dev)->platform_data);	\
> 	if (unlikely(pdata &&						\
> 		     pdata->display.debug & DEBUG_DRIVER_INIT_FUNCTIONS)) \
> 		dev_info(dev, format, ##__VA_ARGS__);
> })

Yes, that is almost readable, I like that a lot better :)

thanks,

greg k-h

      reply	other threads:[~2016-10-02 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-28 20:31 Harman Kalra
2016-09-28 21:27 ` Joe Perches
2016-10-02 15:15   ` 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=20161002151543.GA12676@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=harman4linux@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noralf@tronnes.org \
    --cc=thomas.petazzoni@free-electrons.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome