linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
* [Linux-kernel-mentees] checkpatch.pl investigation: MULTISTATEMENT_MACRO_USE_DO_WHILE issues
@ 2020-09-28 15:47 Dwaipayan Ray
  2020-09-28 16:14 ` Lukas Bulwahn
  0 siblings, 1 reply; 4+ messages in thread
From: Dwaipayan Ray @ 2020-09-28 15:47 UTC (permalink / raw)
  To: Lukas Bulwahn, linux-kernel-mentees

Hi,
Checkpatch seems to generate some false positives on
certain macros.

For example running checkpatch on (kernel/trace/trace_export.c),

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#49: FILE: kernel/trace/trace_export.c:49:
+#define __field_packed(type, container, item) type item;

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#52: FILE: kernel/trace/trace_export.c:52:
+#define __array(type, item, size) type item[size];

and several other same errors.

Wrapping this in a do - while certainly doesn't make sense.
Removing the semicolon at the end of macro and appending semicolon
in the call changes the error to:

ERROR: Macros with complex values should be enclosed in parentheses
#49: FILE: kernel/trace/trace_export.c:49:
+#define __array_desc(type, container, item, size) type item[size]

This seems more reasonable. But the error isn't necessary in the first
place.

Thanks,
Dwaipayan.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

end of thread, other threads:[~2020-09-29  7:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28 15:47 [Linux-kernel-mentees] checkpatch.pl investigation: MULTISTATEMENT_MACRO_USE_DO_WHILE issues Dwaipayan Ray
2020-09-28 16:14 ` Lukas Bulwahn
2020-09-28 17:11   ` Dwaipayan Ray
2020-09-29  7:58     ` Lukas Bulwahn

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).