lkml.org 
[lkml]   [2018]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@gmail.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
\
 
 \ /
  Last update: 2018-08-07 06:08    [W:0.078 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site