public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* checkpatch.pl bug for EXPORT_SYMBOL when struct initialization follows define
@ 2022-06-28 22:10 Joe Simmons-Talbott
  2022-08-18 14:54 ` Joe Simmons-Talbott
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Simmons-Talbott @ 2022-06-28 22:10 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches, Dwaipayan Ray, Lukas Bulwahn,
	linux-kernel

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

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

* Re: checkpatch.pl bug for EXPORT_SYMBOL when struct initialization follows define
  2022-06-28 22:10 checkpatch.pl bug for EXPORT_SYMBOL when struct initialization follows define Joe Simmons-Talbott
@ 2022-08-18 14:54 ` Joe Simmons-Talbott
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Simmons-Talbott @ 2022-08-18 14:54 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches, Dwaipayan Ray, Lukas Bulwahn,
	linux-kernel

On Tue, Jun 28, 2022 at 06:10:41PM -0400, Joe Simmons-Talbott wrote:
> 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.

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

Thanks,
Joe

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

end of thread, other threads:[~2022-08-18 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-28 22:10 checkpatch.pl bug for EXPORT_SYMBOL when struct initialization follows define Joe Simmons-Talbott
2022-08-18 14:54 ` Joe Simmons-Talbott

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