Re: [PATCH 11/11] staging: fbtft: Includes parenthesis around macro parameters and avoids multiple usage of macro parameter - Style

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

 



On Tue, Aug 07, 2018 at 01:07:41AM -0300, Leonardo Brás wrote:
> Signed-off-by: Leonardo Brás <leobras.c@xxxxxxxxx>
> ---
>  drivers/staging/fbtft/fbtft.h | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> index 41ac00239aa3..eb2bdc4870be 100644
> --- a/drivers/staging/fbtft/fbtft.h
> +++ b/drivers/staging/fbtft/fbtft.h
> @@ -411,17 +411,21 @@ module_exit(fbtft_driver_module_exit)
>  #define DEBUG_REQUEST_GPIOS_MATCH	BIT(30)
>  #define DEBUG_VERIFY_GPIOS		BIT(31)
>  
> -#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))) \
> -		dev_info(dev, format, ##arg);                \
> +#define fbtft_init_dbg(dev, format, arg...)				\
> +do {									\
> +	typeof(dev) _dev = (dev);					\
> +	struct fbtft_platform_data *pddev = (void *)_dev->platform_data;\
> +	if (unlikely(pddev &&				\
> +	    (pddev->display.debug &					\
> +	     DEBUG_DRIVER_INIT_FUNCTIONS)))				\
> +		dev_info(_dev, (format), ##arg);			\
>  } while (0)

We're never going to hit this bug ever...  Let's not over engineer
things just for pretend reasons.

Also let's just delete this and replace it with dev_dbg().  You can
turn dev_dbg on for just one function so it already provides everything
we need.

regards,
dan carpenter

_______________________________________________
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