[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3cac26238f63cac9123ad767341daead9aec7717.1533614243.git.leobras.c@gmail.com>
Date: Tue, 7 Aug 2018 01:07:41 -0300
From: Leonardo Brás <leobras.c@...il.com>
To: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 11/11] staging: fbtft: Includes parenthesis around macro
parameters and avoids multiple usage of macro parameter - Style
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)
#define fbtft_par_dbg(level, par, format, arg...) \
do { \
- if (unlikely(par->debug & level)) \
- dev_info(par->info->device, format, ##arg); \
+ typeof(par) _par = (par); \
+ if (unlikely(_par->debug & (level))) \
+ dev_info(_par->info->device, format, ##arg); \
} while (0)
#define fbtft_par_dbg_hex(level, par, dev, type, buf, num, format, arg...) \
--
2.18.0
Powered by blists - more mailing lists