mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Korty <joe.korty@ccur.com>
To: Andy Whitcroft <apw@canonical.com>
Cc: joe.korty@ccur.com, linux-kernel@vger.kernel.org
Subject: checkpatch: forward declarations fix
Date: Wed, 2 May 2012 11:10:46 -0400	[thread overview]
Message-ID: <20120502151046.GA25583@tsunami.ccur.com> (raw)

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

                 reply	other threads:[~2012-05-02 15:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120502151046.GA25583@tsunami.ccur.com \
    --to=joe.korty@ccur.com \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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