Fix checkpatch ERRORS in fbtft.c
Subsystems (2)
cover Fix checkpatch ERRORS in fbtft.c
Hi,
This is my first kernel contribution. I chose a small clean-up patch to ensure I understand the process. Please forgive any mistakes in the submission process - I'm happy to fix anything I missed.
Tony Bronzo (1):
staging: fbtft: fbtft-bus: replace blank modifier with identity()
macro
drivers/staging/fbtft/fbtft-bus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/1 staging: fbtft: fbtft-bus: replace blank modifier with identity() macro
The previous blank 3rd parameter in two define_fbtft_write_reg() calls created a trailing ', )' and triggered:
ERROR: space prohibited before that '('
ERROR: space required after that ','
Introduce a local identity() macro and pass it instead. No functional change.
--- drivers/staging/fbtft/fbtft-bus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/fbtft/fbtft-bus.c +4 -2
@@ -5,6 +5,8 @@#include <linux/spi/spi.h> #include "fbtft.h" +#define identity (x) (x) +/***************************************************************************** * * void (*write_reg)(struct fbtft_par *par, int len, ...);
@@ -62,9 +64,9 @@ out: \ } \EXPORT_SYMBOL (func); -define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, ) +define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, identity) define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16) -define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, ) +define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, identity)void fbtft_write_reg8_bus9 (struct fbtft_par *par,int len, ...) {
Signature · 1 line
2.43.0
Re: [PATCH 1/1] staging: fbtft: fbtft-bus: replace blank modifier with identity() macro
Quoted 7 lines · Tony Bronzo
The previous blank 3rd parameter in two
define_fbtft_write_reg()calls created a trailing ', )' and triggered:ERROR: space prohibited before that '('
ERROR: space required after that ','Introduce a local
identity()macro and pass it instead.
This is a very creative solution and so far as I can see this doesn't break anything. But it does make the code more confusing, so a better solution is to just ignore the checkpatch warning.
Like another solution would be to just say:
#define empty_define /* checkpatch doesn't like macros which end in comma */
Less creative. Slightly simpler. But still no good. Just ignore checkpatch when it is wrong.
regards,
dan carpenter