* [PATCH] Staging : fbtft: Removed "line over 80 characters" Warnings
@ 2016-09-28 20:31 Harman Kalra
2016-09-28 21:27 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Harman Kalra @ 2016-09-28 20:31 UTC (permalink / raw)
To: thomas.petazzoni, noralf; +Cc: gregkh, devel, linux-kernel, Harman Kalra
Removed "line over 80 characters" Warnings using checkpatch.pl
Signed-off-by: Harman Kalra <harman4linux@gmail.com>
---
drivers/staging/fbtft/fbtft.h | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
index 89c4b5b..1c8a250 100644
--- a/drivers/staging/fbtft/fbtft.h
+++ b/drivers/staging/fbtft/fbtft.h
@@ -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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Staging : fbtft: Removed "line over 80 characters" Warnings
2016-09-28 20:31 [PATCH] Staging : fbtft: Removed "line over 80 characters" Warnings Harman Kalra
@ 2016-09-28 21:27 ` Joe Perches
2016-10-02 15:15 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2016-09-28 21:27 UTC (permalink / raw)
To: Harman Kalra, thomas.petazzoni, noralf; +Cc: gregkh, devel, linux-kernel
On Thu, 2016-09-29 at 02:01 +0530, Harman Kalra wrote:
> Removed "line over 80 characters" Warnings using checkpatch.pl
[]
> diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
[]
> @@ -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__);
})
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Staging : fbtft: Removed "line over 80 characters" Warnings
2016-09-28 21:27 ` Joe Perches
@ 2016-10-02 15:15 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2016-10-02 15:15 UTC (permalink / raw)
To: Joe Perches; +Cc: Harman Kalra, thomas.petazzoni, noralf, devel, linux-kernel
On Wed, Sep 28, 2016 at 02:27:37PM -0700, Joe Perches wrote:
> On Thu, 2016-09-29 at 02:01 +0530, Harman Kalra wrote:
> > Removed "line over 80 characters" Warnings using checkpatch.pl
> []
> > diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> []
> > @@ -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__);
> })
Yes, that is almost readable, I like that a lot better :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-02 15:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-28 20:31 [PATCH] Staging : fbtft: Removed "line over 80 characters" Warnings Harman Kalra
2016-09-28 21:27 ` Joe Perches
2016-10-02 15:15 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome