From: Andy Whitcroft Date: Thu, 15 Jan 2009 21:51:07 +0000 (-0800) Subject: checkpatch: struct seq_operations should normally be const X-Git-Tag: v2.6.29-rc2~35 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?p=linux-2.6-omap-h63xx.git;a=commitdiff_plain;h=6903ffb2257266472ef2edd0092d526ae2dc00f7 checkpatch: struct seq_operations should normally be const In the general use case struct seq_operations should be a const object. Check for and warn where it is not. Cc: Ingo Molnar Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 5ea55e330c2..447435c33dd 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