linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Andy Whitcroft <apw@canonical.com>
Subject: [PATCH 5/6] checkpatch: struct seq_operations should normally be const
Date: Mon, 12 Jan 2009 12:45:03 +0000	[thread overview]
Message-ID: <1231764304-1491-6-git-send-email-apw@canonical.com> (raw)
In-Reply-To: <1231764304-1491-1-git-send-email-apw@canonical.com>

In the general use case struct seq_operations should be a const object.
Check for and warn where it is not.

Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 scripts/checkpatch.pl |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5ea55e3..447435c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2527,9 +2527,10 @@ sub process {
 			WARN("please use device_initcall() instead of __initcall()\n" . $herecurr);
 		}
 # check for struct file_operations, ensure they are const.
-		if ($line =~ /\bstruct\s+file_operations\b/ &&
-		    $line !~ /\bconst\b/) {
-			WARN("struct file_operations should normally be const\n" . $herecurr);
+		if ($line !~ /\bconst\b/ &&
+		    $line =~ /\bstruct\s+(file_operations|seq_operations)\b/) {
+			WARN("struct $1 should normally be const\n" .
+				$herecurr);
 		}
 
 # use of NR_CPUS is usually wrong
-- 
1.6.0.4.911.gc990


  parent reply	other threads:[~2009-01-12 12:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-12 12:44 [PATCH 0/6] update checkpatch to version 0.27 Andy Whitcroft
2009-01-12 12:44 ` [PATCH 1/6] checkpatch: handle missing #if open in context Andy Whitcroft
2009-01-12 12:45 ` [PATCH 2/6] checkpatch: type/cast spacing should not check prefix spacing Andy Whitcroft
2009-01-12 12:45 ` [PATCH 3/6] checkpatch: allow parentheses on return handle array values Andy Whitcroft
2009-01-12 12:45 ` [PATCH 4/6] checkpatch: if should not continue a preceeding brace Andy Whitcroft
2009-01-12 12:45 ` Andy Whitcroft [this message]
2009-01-12 12:45 ` [PATCH 6/6] checkpatch: version: 0.27 Andy Whitcroft

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=1231764304-1491-6-git-send-email-apw@canonical.com \
    --to=apw@canonical.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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;
as well as URLs for NNTP newsgroup(s).