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>] [day] [month] [year] [list]
Message-ID: <b345bb7e2d4e23672e3e5d1b283754dc11c7d8cd.1767647872.git.mst@redhat.com>
Date: Mon, 5 Jan 2026 16:18:32 -0500
From: "Michael S. Tsirkin" <mst@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>,
	Dwaipayan Ray <dwaipayanray1@...il.com>,
	Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: [PATCH] checkpatch: special-case cacheline group macros

Currently, cacheline group macros trigger checkpatch warnings.
For example:

  $ ./scripts/checkpatch.pl -g ba7e025a6c84aed012421468d83639e5dae982b0
  WARNING: Missing a blank line after declarations
  #58: FILE: drivers/gpio/gpio-virtio.c:32:
  +	struct virtio_gpio_response res;
  +	__dma_from_device_group_end();

  $ ./scripts/checkpatch.pl -g 5d4cc87414c5d11345c4b11d61377d351b5c28a2
  WARNING: Missing a blank line after declarations
  #267: FILE: include/net/sock.h:431:
  +	int			sk_rcvlowat;
  +	__cacheline_group_end(sock_read_rx);

But these are not statements actually - the following macros
all expand to zero-length fields:
  __cacheline_group_begin()
  __cacheline_group_end()
  __cacheline_group_begin_aligned()
  __cacheline_group_end_aligned()
  __dma_from_device_group_begin()
  __dma_from_device_group_end()

Add them to $declaration_macros so checkpatch recognizes this fact.

Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
---

Note: ba7e025a6c84aed012421468d83639e5dae982b0 is only in my tree
at this point, but is intended for next.


 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c0250244cf7a..f71dd9cbddfb 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1100,7 +1100,9 @@ our $declaration_macros = qr{(?x:
 	(?:$Storage\s+)?(?:[A-Z_][A-Z0-9]*_){0,2}(?:DEFINE|DECLARE)(?:_[A-Z0-9]+){1,6}\s*\(|
 	(?:$Storage\s+)?[HLP]?LIST_HEAD\s*\(|
 	(?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(|
-	(?:$Storage\s+)?(?:XA_STATE|XA_STATE_ORDER)\s*\(
+	(?:$Storage\s+)?(?:XA_STATE|XA_STATE_ORDER)\s*\(|
+	__cacheline_group_(?:begin|end)(?:_aligned)?\s*\(|
+	__dma_from_device_group_(?:begin|end)\s*\(
 )};
 
 our %allow_repeated_words = (
-- 
MST


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ