[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180807074602.b4bksw5ridqvphxl@mwanda>
Date: Tue, 7 Aug 2018 10:46:02 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Leonardo Brás <leobras.c@...il.com>
Cc: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
devel@...verdev.osuosl.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 11/11] staging: fbtft: Includes parenthesis around macro
parameters and avoids multiple usage of macro parameter - Style
On Tue, Aug 07, 2018 at 01:07:41AM -0300, Leonardo Brás wrote:
> Signed-off-by: Leonardo Brás <leobras.c@...il.com>
> ---
> 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
Powered by blists - more mailing lists