lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2cf34cff-717b-41b7-96ba-2041028bc0f0@suswa.mountain>
Date: Fri, 27 Jun 2025 23:15:27 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Abdalla Ahmad <Abdalla.Ahmad@...ame.org.jo>
Cc: Dave Penkler <dpenkler@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Michael Rubin <matchstick@...erthere.org>,
	Arnd Bergmann <arnd@...db.de>,
	Paul Retourné <paul.retourne@...nge.fr>,
	"open list:STAGING SUBSYSTEM" <linux-staging@...ts.linux.dev>,
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drivers: staging: gpib: minor fixes for some C macros.

On Fri, Jun 27, 2025 at 07:53:21PM +0000, Abdalla Ahmad wrote:
> Hi
> 
> > This breaks the build.
> Sorry but how is this breaking the build? Putting checkpatch.pl aside, intuitively it makes sense to wrap long macros in parenthesis to avoid compile time errors and runtime bugs...
> 

Take a look at how the LINVAL define is used and then try building
the gpib_bitbang.o file.

$ make drivers/staging/gpib/gpio/gpib_bitbang.o 2>&1 | head -n 30
  CALL    scripts/checksyscalls.sh
  DESCEND objtool
  INSTALL libsubcmd_headers
  CC      drivers/staging/gpib/gpio/gpib_bitbang.o
In file included from ./include/linux/printk.h:616,
                 from ./include/asm-generic/bug.h:28,
                 from ./arch/x86/include/asm/bug.h:103,
                 from ./arch/x86/include/asm/alternative.h:9,
                 from ./arch/x86/include/asm/atomic.h:7,
                 from ./include/linux/atomic.h:7,
                 from ./drivers/staging/gpib/include/gpib_types.h:12,
                 from ./drivers/staging/gpib/include/gpibP.h:12,
                 from drivers/staging/gpib/gpio/gpib_bitbang.c:56:
drivers/staging/gpib/gpio/gpib_bitbang.c: In function ‘bb_read’:
<command-line>: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
./include/linux/dynamic_debug.h:224:29: note: in definition of macro ‘__dynamic_func_call_cls’
  224 |                 func(&id, ##__VA_ARGS__);                       \
      |                             ^~~~~~~~~~~
./include/linux/dynamic_debug.h:250:9: note: in expansion of macro ‘_dynamic_func_call_cls’
  250 |         _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
      |         ^~~~~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:273:9: note: in expansion of macro ‘_dynamic_func_call’
  273 |         _dynamic_func_call(fmt, __dynamic_dev_dbg,              \
      |         ^~~~~~~~~~~~~~~~~~
./include/linux/dev_printk.h:165:9: note: in expansion of macro ‘dynamic_dev_dbg’
  165 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
      |         ^~~~~~~~~~~~~~~
drivers/staging/gpib/gpio/gpib_bitbang.c:28:21: note: in expansion of macro ‘KBUILD_MODNAME’
   28 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
      |                     ^~~~~~~~~~~~~~

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ