Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751238AbbBJGMO (ORCPT ); Tue, 10 Feb 2015 01:12:14 -0500 Received: from mail-we0-f181.google.com ([74.125.82.181]:65285 "EHLO mail-we0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751131AbbBJGMM (ORCPT ); Tue, 10 Feb 2015 01:12:12 -0500 MIME-Version: 1.0 In-Reply-To: <1423503278.2933.20.camel@perches.com> References: <1423503278.2933.20.camel@perches.com> From: Rob Herring Date: Tue, 10 Feb 2015 00:11:51 -0600 Message-ID: Subject: Re: [PATCH] checkpatch: Add of_device_id to structs that should be const To: Joe Perches Cc: Andrew Morton , Andy Whitcroft , Grant Likely , Rob Herring , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2277 Lines: 53 On Mon, Feb 9, 2015 at 11:34 AM, Joe Perches wrote: > Uses of struct of_device_id are most commonly const. > > Suggest using it as such. > > Signed-off-by: Joe Perches Acked-by: Rob Herring > --- > scripts/checkpatch.pl | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 3642b0d..368db0d 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -5216,8 +5216,9 @@ sub process { > "please use device_initcall() or more appropriate function instead of __initcall() (see include/linux/init.h)\n" . $herecurr); > } > > -# check for various ops structs, ensure they are const. > - my $struct_ops = qr{acpi_dock_ops| > +# check for various structs that are normally const (ops, kgdb, device_tree) > + my $const_structs = qr{ > + acpi_dock_ops| > address_space_operations| > backlight_ops| > block_device_operations| > @@ -5240,6 +5241,7 @@ sub process { > mtrr_ops| > neigh_ops| > nlmsvc_binding| > + of_device_id| > pci_raw_ops| > pipe_buf_operations| > platform_hibernation_ops| > @@ -5255,7 +5257,7 @@ sub process { > usb_mon_operations| > wd_ops}x; > if ($line !~ /\bconst\b/ && > - $line =~ /\bstruct\s+($struct_ops)\b/) { > + $line =~ /\bstruct\s+($const_structs)\b/) { > WARN("CONST_STRUCT", > "struct $1 should normally be const\n" . > $herecurr); > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/