linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: fbtft: fix macro usage and style warnings
@ 2025-09-19 21:29 DeepanshuPratik
  2025-09-20  8:37 ` kernel test robot
  2025-10-13 20:51 ` Andy Shevchenko
  0 siblings, 2 replies; 3+ messages in thread
From: DeepanshuPratik @ 2025-09-19 21:29 UTC (permalink / raw)
  To: andy; +Cc: gregkh, dri-devel, linux-fbdev, DeepanshuPratik

This patch fixes the trailing comma issue in the
define_fbtft_write_reg() macro calls, which caused
checkpatch.pl to complain with:

  ERROR: space prohibited before that close parenthesis ')'

The affected macro invocations were updated to pass an
identity modifier instead of leaving the argument empty.
This resolves build errors while ensuring compliance
with kernel coding style.

No functional changes are introduced; this patch only
addresses build and style issues.

Signed-off-by: DeepanshuPratik <deepanshu.pratik@gmail.com>
---
 drivers/staging/fbtft/fbtft-bus.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
index 30e436ff1..60846185d 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -11,6 +11,7 @@
  *
  *****************************************************************************/
 
+#define NOOP(x) (x)                                                           \
 #define define_fbtft_write_reg(func, buffer_type, data_type, modifier)        \
 void func(struct fbtft_par *par, int len, ...)                                \
 {                                                                             \
@@ -62,9 +63,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, NOOP)
 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, NOOP)
 
 void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
 {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: fbtft: fix macro usage and style warnings
  2025-09-19 21:29 [PATCH] staging: fbtft: fix macro usage and style warnings DeepanshuPratik
@ 2025-09-20  8:37 ` kernel test robot
  2025-10-13 20:51 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-09-20  8:37 UTC (permalink / raw)
  To: DeepanshuPratik, andy
  Cc: llvm, oe-kbuild-all, gregkh, dri-devel, linux-fbdev,
	DeepanshuPratik

Hi DeepanshuPratik,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/DeepanshuPratik/staging-fbtft-fix-macro-usage-and-style-warnings/20250920-053248
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20250919212938.822374-1-deepanshu.pratik%40gmail.com
patch subject: [PATCH] staging: fbtft: fix macro usage and style warnings
config: x86_64-buildonly-randconfig-002-20250920 (https://download.01.org/0day-ci/archive/20250920/202509201601.hTKUjeIe-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250920/202509201601.hTKUjeIe-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509201601.hTKUjeIe-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/staging/fbtft/fbtft-bus.c:15:2: error: '#' is not followed by a macro parameter
      15 | #define define_fbtft_write_reg(func, buffer_type, data_type, modifier)        \
         |  ^
>> drivers/staging/fbtft/fbtft-bus.c:66:47: error: unexpected type name 'u8': expected identifier
      66 | define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, NOOP)
         |                                               ^
   drivers/staging/fbtft/fbtft-bus.c:66:51: error: unexpected type name 'u8': expected identifier
      66 | define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, NOOP)
         |                                                   ^
>> drivers/staging/fbtft/fbtft-bus.c:66:51: error: redefinition of parameter 'u8'
>> drivers/staging/fbtft/fbtft-bus.c:67:1: error: expected function body after function declarator
      67 | define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16)
         | ^
   5 errors generated.


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

c296d5f9957c039 Thomas Petazzoni   2014-12-31   7  
c296d5f9957c039 Thomas Petazzoni   2014-12-31   8  /*****************************************************************************
c296d5f9957c039 Thomas Petazzoni   2014-12-31   9   *
c296d5f9957c039 Thomas Petazzoni   2014-12-31  10   *   void (*write_reg)(struct fbtft_par *par, int len, ...);
c296d5f9957c039 Thomas Petazzoni   2014-12-31  11   *
c296d5f9957c039 Thomas Petazzoni   2014-12-31  12   *****************************************************************************/
c296d5f9957c039 Thomas Petazzoni   2014-12-31  13  
49f31092c55579e DeepanshuPratik    2025-09-20  14  #define NOOP(x) (x)                                                           \
8d8825b420ffb37 Alfonso Lima Astor 2017-10-17 @15  #define define_fbtft_write_reg(func, buffer_type, data_type, modifier)        \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  16  void func(struct fbtft_par *par, int len, ...)                                \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  17  {                                                                             \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  18  	va_list args;                                                         \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  19  	int i, ret;                                                           \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  20  	int offset = 0;                                                       \
8d8825b420ffb37 Alfonso Lima Astor 2017-10-17  21  	buffer_type *buf = (buffer_type *)par->buf;                           \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  22  									      \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  23  	if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {                    \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  24  		va_start(args, len);                                          \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  25  		for (i = 0; i < len; i++) {                                   \
cc1c0eea8527bd2 Renato Soma        2018-04-17  26  			buf[i] = modifier((data_type)va_arg(args,             \
cc1c0eea8527bd2 Renato Soma        2018-04-17  27  							    unsigned int));   \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  28  		}                                                             \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  29  		va_end(args);                                                 \
cc1c0eea8527bd2 Renato Soma        2018-04-17  30  		fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par,                  \
cc1c0eea8527bd2 Renato Soma        2018-04-17  31  				  par->info->device, buffer_type, buf, len,   \
cc1c0eea8527bd2 Renato Soma        2018-04-17  32  				  "%s: ", __func__);                          \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  33  	}                                                                     \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  34  									      \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  35  	va_start(args, len);                                                  \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  36  									      \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  37  	if (par->startbyte) {                                                 \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  38  		*(u8 *)par->buf = par->startbyte;                             \
8d8825b420ffb37 Alfonso Lima Astor 2017-10-17  39  		buf = (buffer_type *)(par->buf + 1);                          \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  40  		offset = 1;                                                   \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  41  	}                                                                     \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  42  									      \
8d8825b420ffb37 Alfonso Lima Astor 2017-10-17  43  	*buf = modifier((data_type)va_arg(args, unsigned int));               \
cc1c0eea8527bd2 Renato Soma        2018-04-17  44  	ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset,   \
cc1c0eea8527bd2 Renato Soma        2018-04-17  45  				 0);                                          \
e70065fdc11d86f Heiner Kallweit    2017-03-02  46  	if (ret < 0)							      \
e70065fdc11d86f Heiner Kallweit    2017-03-02  47  		goto out;						      \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  48  	len--;                                                                \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  49  									      \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  50  	if (par->startbyte)                                                   \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  51  		*(u8 *)par->buf = par->startbyte | 0x2;                       \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  52  									      \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  53  	if (len) {                                                            \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  54  		i = len;                                                      \
e70065fdc11d86f Heiner Kallweit    2017-03-02  55  		while (i--)						      \
cc1c0eea8527bd2 Renato Soma        2018-04-17  56  			*buf++ = modifier((data_type)va_arg(args,             \
cc1c0eea8527bd2 Renato Soma        2018-04-17  57  							    unsigned int));   \
e70065fdc11d86f Heiner Kallweit    2017-03-02  58  		fbtft_write_buf_dc(par, par->buf,			      \
8d8825b420ffb37 Alfonso Lima Astor 2017-10-17  59  				   len * (sizeof(data_type) + offset), 1);    \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  60  	}                                                                     \
e70065fdc11d86f Heiner Kallweit    2017-03-02  61  out:									      \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  62  	va_end(args);                                                         \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  63  }                                                                             \
c296d5f9957c039 Thomas Petazzoni   2014-12-31  64  EXPORT_SYMBOL(func);
c296d5f9957c039 Thomas Petazzoni   2014-12-31  65  
49f31092c55579e DeepanshuPratik    2025-09-20 @66  define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, NOOP)
8d8825b420ffb37 Alfonso Lima Astor 2017-10-17 @67  define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16)
49f31092c55579e DeepanshuPratik    2025-09-20  68  define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, NOOP)
c296d5f9957c039 Thomas Petazzoni   2014-12-31  69  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: fbtft: fix macro usage and style warnings
  2025-09-19 21:29 [PATCH] staging: fbtft: fix macro usage and style warnings DeepanshuPratik
  2025-09-20  8:37 ` kernel test robot
@ 2025-10-13 20:51 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2025-10-13 20:51 UTC (permalink / raw)
  To: DeepanshuPratik; +Cc: andy, gregkh, dri-devel, linux-fbdev

On Sat, Sep 20, 2025 at 02:59:38AM +0530, DeepanshuPratik wrote:
> This patch fixes the trailing comma issue in the
> define_fbtft_write_reg() macro calls, which caused
> checkpatch.pl to complain with:
> 
>   ERROR: space prohibited before that close parenthesis ')'

Please. go and fix checkpatch instead.

> The affected macro invocations were updated to pass an
> identity modifier instead of leaving the argument empty.
> This resolves build errors while ensuring compliance
> with kernel coding style.
> 
> No functional changes are introduced; this patch only
> addresses build and style issues.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-18 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-19 21:29 [PATCH] staging: fbtft: fix macro usage and style warnings DeepanshuPratik
2025-09-20  8:37 ` kernel test robot
2025-10-13 20:51 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).