Re: [PATCH] Staging : fbtft: Removed "line over 80 characters" Warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux