mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* checkpatch: forward declarations fix
@ 2012-05-02 15:10 Joe Korty
  0 siblings, 0 replies; only message in thread
From: Joe Korty @ 2012-05-02 15:10 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: joe.korty, linux-kernel

Allow forward declarations of the form:

	struct file_operations;

to exist without requiring the preceeding 'const'. In
any case C does not allow 'const' on forward declarations.

Signed-off-by: Joe Korty <joe.korty@ccur.com>

Index: linux/scripts/checkpatch.pl
===================================================================
--- linux.orig/scripts/checkpatch.pl	2012-05-02 10:29:03.000000000 -0400
+++ linux/scripts/checkpatch.pl	2012-05-02 10:38:45.000000000 -0400
@@ -3411,9 +3411,11 @@
 				wd_ops}x;
 		if ($line !~ /\bconst\b/ &&
 		    $line =~ /\bstruct\s+($struct_ops)\b/) {
-			WARN("CONST_STRUCT",
-			     "struct $1 should normally be const\n" .
-				$herecurr);
+			if ($line !~ /struct\s+($struct_ops);/) {
+				WARN("CONST_STRUCT",
+				     "struct $1 should normally be const\n" .
+					$herecurr);
+			}
 		}
 
 # use of NR_CPUS is usually wrong

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-02 15:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-02 15:10 checkpatch: forward declarations fix Joe Korty

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

Powered by JetHome