Skip to contentSkip to conversation

Staging : fbtft: Removed "line over 80 characters" Warnings

PATCH In review Harman Kalra 3 participants 3 messages Sep 28, 2016 – Oct 2, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging : fbtft: Removed "line over 80 characters" Warnings

Removed "line over 80 characters" Warnings using checkpatch.pl

---
 drivers/staging/fbtft/fbtft.h |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/staging/fbtft/fbtft.h +13 -5
index 89c4b5b..1c8a250 100644
@@ -358,9 +358,14 @@ static void __exit fbtft_driver_module_exit(void)                          \
 
 /* shorthand debug levels */
 #define DEBUG_LEVEL_1	DEBUG_REQUEST_GPIOS
-#define DEBUG_LEVEL_2	(DEBUG_LEVEL_1 | DEBUG_DRIVER_INIT_FUNCTIONS | DEBUG_TIME_FIRST_UPDATE)
-#define DEBUG_LEVEL_3	(DEBUG_LEVEL_2 | DEBUG_RESET | DEBUG_INIT_DISPLAY | DEBUG_BLANK | DEBUG_REQUEST_GPIOS | DEBUG_FREE_GPIOS | DEBUG_VERIFY_GPIOS | DEBUG_BACKLIGHT | DEBUG_SYSFS)
-#define DEBUG_LEVEL_4	(DEBUG_LEVEL_2 | DEBUG_FB_READ | DEBUG_FB_WRITE | DEBUG_FB_FILLRECT | DEBUG_FB_COPYAREA | DEBUG_FB_IMAGEBLIT | DEBUG_FB_BLANK)
+#define DEBUG_LEVEL_2	(DEBUG_LEVEL_1 | DEBUG_DRIVER_INIT_FUNCTIONS \
+			| DEBUG_TIME_FIRST_UPDATE)
+#define DEBUG_LEVEL_3	(DEBUG_LEVEL_2 | DEBUG_RESET | DEBUG_INIT_DISPLAY \
+			| DEBUG_BLANK | DEBUG_REQUEST_GPIOS | DEBUG_FREE_GPIOS \
+			| DEBUG_VERIFY_GPIOS | DEBUG_BACKLIGHT | DEBUG_SYSFS)
+#define DEBUG_LEVEL_4	(DEBUG_LEVEL_2 | DEBUG_FB_READ | DEBUG_FB_WRITE \
+			| DEBUG_FB_FILLRECT | DEBUG_FB_COPYAREA \
+			| DEBUG_FB_IMAGEBLIT | DEBUG_FB_BLANK)
 #define DEBUG_LEVEL_5	(DEBUG_LEVEL_3 | DEBUG_UPDATE_DISPLAY)
 #define DEBUG_LEVEL_6	(DEBUG_LEVEL_4 | DEBUG_LEVEL_5)
 #define DEBUG_LEVEL_7	0xFFFFFFFF
@@ -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)
 
@@ -415,7 +422,8 @@ static void __exit fbtft_driver_module_exit(void)                          \
 #define fbtft_par_dbg_hex(level, par, dev, type, buf, num, format, arg...) \
 do {                                                                       \
 	if (unlikely(par->debug & level))                                  \
-		fbtft_dbg_hex(dev, sizeof(type), buf, num * sizeof(type), format, ##arg); \
+		fbtft_dbg_hex(dev, sizeof(type), buf, \
+			num * sizeof(type), format, ##arg); \
 } while (0)
 
 #endif /* __LINUX_FBTFT_H */

--
1.7.9.5

#1 lore raw
Quoted 1 line · Harman Kalra

Removed "line over 80 characters" Warnings using checkpatch.pl

[]

drivers/staging/fbtft/fbtft.h

Quoted 1 line
drivers/staging/fbtft/fbtft.h +0 -0

[]

drivers/staging/fbtft/fbtft.h static void __exit fbtft_driver_module_exit(void) \ · line 414

Quoted 10 lines
drivers/staging/fbtft/fbtft.h +3 -1
@@ -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__);
})
maintainer
#2 lore raw
Quoted 18 lines · Joe Perches
Quoted 1 line · Harman Kalra

Removed "line over 80 characters" Warnings using checkpatch.pl

[]

drivers/staging/fbtft/fbtft.h

Quoted 1 line
drivers/staging/fbtft/fbtft.h +0 -0

[]

drivers/staging/fbtft/fbtft.h static void __exit fbtft_driver_module_exit(void) \ · line 414

Quoted 10 lines
drivers/staging/fbtft/fbtft.h +3 -1
@@ -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

Quoted 8 lines

#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