Skip to contentSkip to conversation

staging: fbtft: fix space prohibited before that close parenthesis

PATCH In review Eric LI 3 participants 4 messages Oct 31 – Nov 3

Subsystems (3)
lore
Share & tools
lore

Eric LI

author
#0 lore raw

PATCH 1/1 staging: fbtft: fix space prohibited before that close parenthesis

Clean up the following checkpatch error and warning in fbtft-bus.c. drivers/staging/fbtft/fbtft-bus.c:14: WARNING: macros should not use a trailing semicolon drivers/staging/fbtft/fbtft-bus.c:65: ERROR: space prohibited before that close parenthesis ')' drivers/staging/fbtft/fbtft-bus.c:67: ERROR: space prohibited before that close parenthesis ')'

The reason of that error is the modifier argument is optional to the macro define_fbtft_write_reg. So, even if removing the space before close parenthesis, another error "space required after that ','" occurs.

In this fix, I change that modifier argument as optional, so that it is both ok to use that macro with or without modifier argument.

---
 drivers/staging/fbtft/fbtft-bus.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/fbtft/fbtft-bus.c +5 -5
index 30e436ff19e4..e483ecb10938 100644
@@ -11,7 +11,7 @@
  *
  *****************************************************************************/
 
-#define define_fbtft_write_reg(func, buffer_type, data_type, modifier)        \
+#define define_fbtft_write_reg(func, buffer_type, data_type, modifier...)        \
 void func(struct fbtft_par *par, int len, ...)                                \
 {                                                                             \
 	va_list args;                                                         \
@@ -60,11 +60,11 @@ void func(struct fbtft_par *par, int len, ...)                                \
 out:									      \
 	va_end(args);                                                         \
 }                                                                             \
-EXPORT_SYMBOL(func);
+EXPORT_SYMBOL(func)
 
-define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
-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_reg8_bus8, u8, u8);
+define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16);
+define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16);
 
 void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
 {
Signature · 1 line
2.34.1
#1 lore raw
Quoted 6 lines · Eric LI

Clean up the following checkpatch error and warning in fbtft-bus.c. drivers/staging/fbtft/fbtft-bus.c:14: WARNING: macros should not use a trailing semicolon drivers/staging/fbtft/fbtft-bus.c:65: ERROR: space prohibited before that close parenthesis ')' drivers/staging/fbtft/fbtft-bus.c:67: ERROR: space prohibited before that close parenthesis ')'

Quoted 6 lines

The reason of that error is the modifier argument is optional to the macro define_fbtft_write_reg. So, even if removing the space before close parenthesis, another error "space required after that ','" occurs.

In this fix, I change that modifier argument as optional, so that it is both ok to use that macro with or without modifier argument.

It's not a fix, it does not fix anything.
Also study the mailing list archive (lore.kernel.org) to see what happened to the similar patches in the past.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author
#2 lore raw
Quoted 4 lines · Andy Shevchenko

It's not a fix, it does not fix anything.
Also study the mailing list archive (lore.kernel.org) to see what happened to the similar patches in the past.

Thanks for your feedback. I did check the mailing list archive for the same Checkpatch error in staging/fbtft.

They either removed the extra space between ‘,’ and ‘)’ that caused another checkpatch error “space required after that ‘,’”,
or removed both ‘,’ and extra space before ‘)’ that caused build error.

The key difference in my change here is to make that argument “modifier” as variable argument, not a positional argument anymore. After that, I could safely remove both ‘,’ and extra space before ‘)’, without further checkpatch error.

It passed my build and verificaton based on the file "fbtft-bus.i”.

It is fine for me if you think that it is not worth removing that checkpatch error.

--
Best Regard,
Eric LI

Reviewed-by on v1 1/1
#3 lore raw
In reply to Eric LI

I'm going to Ack this patch. The other patches to silence this warning introduced weird no-op macros but I feel like this patch does the right thing.

I don't really care if the patch gets merged or not, but in your heart you will know that I approved it and hopefully that counts for something. :P

regards,
dan carpenter