From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754650AbZALMpl (ORCPT ); Mon, 12 Jan 2009 07:45:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751827AbZALMpN (ORCPT ); Mon, 12 Jan 2009 07:45:13 -0500 Received: from adelie.canonical.com ([91.189.90.139]:40577 "EHLO adelie.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751025AbZALMpL (ORCPT ); Mon, 12 Jan 2009 07:45:11 -0500 From: Andy Whitcroft To: Andrew Morton Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Andy Whitcroft Subject: [PATCH 5/6] checkpatch: struct seq_operations should normally be const Date: Mon, 12 Jan 2009 12:45:03 +0000 Message-Id: <1231764304-1491-6-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.6.0.4.911.gc990 In-Reply-To: <1231764304-1491-1-git-send-email-apw@canonical.com> References: <1231764304-1491-1-git-send-email-apw@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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