mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] scripts/checkpatch.pl: false positive missing parentheses
@ 2018-05-07 18:31 Heinrich Schuchardt
  2018-05-07 20:43 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Heinrich Schuchardt @ 2018-05-07 18:31 UTC (permalink / raw)
  To: Joe Perches; +Cc: Andy Whitcroft, linux-kernel, Heinrich Schuchardt

This patch creates a false positive:
ERROR: Macros with complex values should be enclosed in parentheses

Here we define a constant that can be used to initialize a structure.
Adding parentheses would lead to a compile time error:
error: braced-group within expression allowed only inside a function

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 foo.h | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 foo.h

diff --git a/foo.h b/foo.h
new file mode 100644
index 000000000000..e2cba533f065
--- /dev/null
+++ b/foo.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: BSD-2 */
+#define EFI_ST_DISK_IMG { 0x00003368, { \
+	{0x00000d40, "\x6f\x63\x00\x2f\x2a\x00\x20\x2a"}, /* oc./*. * */ \
+	{0x00000d48, "\x00\x20\x2a\x2f\x0a\x00\x09\x7b"}, /* . */...{ */ \
+	{0x00000d50, "\x30\x78\x25\x30\x38\x7a\x78\x2c"}, /* 0x%08zx, */ \
+	{0x00000d58, "\x20\x22\x00\x5c\x78\x25\x30\x32"}, /*  ".\x%02 */ \
+	{0x00000d60, "\x78\x00\x20\x2a\x2f\x20\x5c\x00"}, /* x. */ \. */ \
+	{0, NULL} } }
-- 
2.17.0

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

end of thread, other threads:[~2018-05-07 20:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-07 18:31 [BUG] scripts/checkpatch.pl: false positive missing parentheses Heinrich Schuchardt
2018-05-07 20:43 ` Joe Perches
2018-05-07 20:52   ` Heinrich Schuchardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®