Skip to contentSkip to conversation

checkpatch.pl bug for EXPORT_SYMBOL when struct initialization follows define

DISCUSSION Joe Simmons-Talbott 1 participant 2 messages Jun 28, 2022 – Aug 18, 2022

lore
Share & tools
lore
#0 lore raw

I believe I've found a bug in checkpatch.pl where an EXPORT_SYMBOL for an initialized struct following a simple #define without an intervening blank line falsely reports that EXPORT_SYMBOL doesn't follow the symbol definition. Here's an example:

	#define SOMETHING_ELSE 1
	struct blah foo = {
		.a = 1
	};
	EXPORT_SYMBOL(foo);

You can see from the debug print that the full statement has not been identified.

	FOO A<+EXPORT_SYMBOL(foo);> stat<+      .a = 1
	 };> name<foo>

Unfortunately my perl skills were not sufficient to find a fix.

Thanks,
Joe

#1 lore raw
Quoted 11 lines · Joe Simmons-Talbott

I believe I've found a bug in checkpatch.pl where an EXPORT_SYMBOL for an initialized struct following a simple #define without an intervening blank line falsely reports that EXPORT_SYMBOL doesn't follow the symbol definition. Here's an example:

	#define SOMETHING_ELSE 1
	struct blah foo = {
		.a = 1
	};
	EXPORT_SYMBOL(foo);
Quoted 7 lines

You can see from the debug print that the full statement has not been identified.

	FOO A<+EXPORT_SYMBOL(foo);> stat<+      .a = 1
	 };> name<foo>

Unfortunately my perl skills were not sufficient to find a fix.

I created the following BZ https://bugzilla.kernel.org/show_bug.cgi?id=216374

Thanks,
Joe