Skip to contentSkip to conversation

staging: fbtft: Moves ";" from macro definition to macro usage.

PATCH New Leonardo Brás 2 participants 3 messages Aug 9, 2018 – Aug 10, 2018 1 message not in the archive

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

PATCH 1/2 staging: fbtft: Moves ";" from macro definition to macro usage.

In reply to a message not in the archive

This makes the macro usage more like a function declaration. Also, ending a macro definition with ";" is not recommended by checkpatch.pl.

---
 drivers/staging/fbtft/fbtft-bus.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/fbtft/fbtft-bus.c +4 -4
index 8ce1ff9b6c2a..274388313780 100644
@@ -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, );
+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.18.0
#3 lore raw

PATCH 2/2 staging: fbtft: Adds space around "/"

In reply to a message not in the archive

Kernel coding style recommends a space char around "/".

---
 drivers/staging/fbtft/fbtft.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fbtft.h +1 -1
index 798a8fe98e95..25302ffc4000 100644
@@ -232,7 +232,7 @@ struct fbtft_par {
 	bool polarity;
 };
 
-#define NUMARGS(...)  (sizeof((int[]){__VA_ARGS__})/sizeof(int))
+#define NUMARGS(...)  (sizeof((int[]){__VA_ARGS__}) / sizeof(int))
 
 #define write_reg(par, ...)                                            \
 	((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
Signature · 1 line
2.18.0
#2 lore raw
In reply to Leonardo Brás
Thank you for the patch! Perhaps something to improve:

Hi Leonardo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.18-rc8 next-20180809]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Leonardo-Br-s/staging-fbtft-Moves-from-macro-definition-to-macro-usage/20180810-154004
reproduce:

        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__

sparse warnings: (new ones prefixed by >>)

>> drivers/staging/fbtft/fbtft-bus.c:66:1: sparse: incorrect type in assignment (different base types) @@    expected restricted __be16 [usertype] <noident> @@    got unsignedrestricted __be16 [usertype] <noident> @@
   drivers/staging/fbtft/fbtft-bus.c:66:1:    expected restricted __be16 [usertype] <noident>
   drivers/staging/fbtft/fbtft-bus.c:66:1:    got unsigned short [unsigned] [usertype] <noident>
>> drivers/staging/fbtft/fbtft-bus.c:66:1: sparse: incorrect type in assignment (different base types) @@    expected restricted __be16 [usertype] <noident> @@    got unsignedrestricted __be16 [usertype] <noident> @@
   drivers/staging/fbtft/fbtft-bus.c:66:1:    expected restricted __be16 [usertype] <noident>
   drivers/staging/fbtft/fbtft-bus.c:66:1:    got unsigned short [unsigned] [usertype] <noident>
>> drivers/staging/fbtft/fbtft-bus.c:66:1: sparse: incorrect type in assignment (different base types) @@    expected restricted __be16 [usertype] <noident> @@    got unsignedrestricted __be16 [usertype] <noident> @@

drivers/staging/fbtft/fbtft-bus.c:66:1: expected restricted __be16 [usertype] <noident>
drivers/staging/fbtft/fbtft-bus.c:66:1: got unsigned short [unsigned] [usertype] <noident>
drivers/staging/fbtft/fbtft-bus.c:156:27: sparse: expression using sizeof(void) drivers/staging/fbtft/fbtft-bus.c:156:27: sparse: expression using sizeof(void) drivers/staging/fbtft/fbtft-bus.c:200:27: sparse: expression using sizeof(void) drivers/staging/fbtft/fbtft-bus.c:200:27: sparse: expression using sizeof(void)

vim +66 drivers/staging/fbtft/fbtft-bus.c

    64	
    65	define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, );
  > 66	define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, );
    67	define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, );
    68	

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation