This makes the macro usage more like a function declaration. Also, ending a macro definition with ";" is not recommended by checkpatch.pl. Signed-off-by: Leonardo Brás <leobras.c@gmail.com> --- drivers/staging/fbtft/fbtft-bus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c index 8ce1ff9b6c2a..274388313780 100644 --- a/drivers/staging/fbtft/fbtft-bus.c +++ b/drivers/staging/fbtft/fbtft-bus.c @@ -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, ...) { -- 2.18.0
Kernel coding style recommends a space char around "/". Signed-off-by: Leonardo Brás <leobras.c@gmail.com> --- drivers/staging/fbtft/fbtft.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h index 798a8fe98e95..25302ffc4000 100644 --- a/drivers/staging/fbtft/fbtft.h +++ b/drivers/staging/fbtft/fbtft.h @@ -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__)) -- 2.18.0
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