From patchwork Fri Jul 18 18:05:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 4587061 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7E6EBC0514 for ; Fri, 18 Jul 2014 18:13:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AB28320166 for ; Fri, 18 Jul 2014 18:13:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D9DFA20176 for ; Fri, 18 Jul 2014 18:13:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E2A496E7D2; Fri, 18 Jul 2014 11:13:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtprelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D69C6E7CD for ; Fri, 18 Jul 2014 11:05:46 -0700 (PDT) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 6CBE2C1F73; Fri, 18 Jul 2014 18:05:45 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: X-HE-Tag: pigs22_6bcc2b39e7346 X-Filterd-Recvd-Size: 3628 Received: from [192.168.1.162] (pool-71-103-235-196.lsanca.fios.verizon.net [71.103.235.196]) (Authenticated sender: joe@perches.com) by omf09.hostedemail.com (Postfix) with ESMTPA; Fri, 18 Jul 2014 18:05:40 +0000 (UTC) Message-ID: <1405706739.14358.68.camel@joe-AO725> Subject: Re: [PATCH 0/25] Replace DEFINE_PCI_DEVICE_TABLE macro use From: Joe Perches To: Greg KH Date: Fri, 18 Jul 2014 11:05:39 -0700 In-Reply-To: <20140718164340.GA24960@kroah.com> References: <1405697232-11785-1-git-send-email-benoit.taine@lip6.fr> <20140718162213.GC31114@tuxdriver.com> <20140718164340.GA24960@kroah.com> X-Mailer: Evolution 3.10.4-0ubuntu1 Mime-Version: 1.0 X-Mailman-Approved-At: Fri, 18 Jul 2014 11:13:28 -0700 Cc: linux-mips@linux-mips.org, linux-fbdev@vger.kernel.org, linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, Benoit Taine , ath5k-devel@venema.h4ckr.net, linux-acenic@sunsite.dk, linux-scsi@vger.kernel.org, users@rt2x00.serialmonkey.com, linux-rdma@vger.kernel.org, ath10k@lists.infradead.org, linux-hippi@sunsite.dk, industrypack-devel@lists.sourceforge.net, linux-wireless@vger.kernel.org, xen-devel@lists.xenproject.org, MPT-FusionLinux.pdl@avagotech.com, ath9k-devel@venema.h4ckr.net, wil6210@qca.qualcomm.com, linux-pcmcia@lists.infradead.org, "John W. Linville" , linux-can@vger.kernel.org, platform-driver-x86@vger.kernel.org, netdev@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, e1000-devel@lists.sourceforge.net, linux-crypto@vger.kernel.org, devel@linuxdriverproject.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 2014-07-18 at 09:43 -0700, Greg KH wrote: > On Fri, Jul 18, 2014 at 12:22:13PM -0400, John W. Linville wrote: > > On Fri, Jul 18, 2014 at 05:26:47PM +0200, Benoit Taine wrote: > > > We should prefer `const struct pci_device_id` over > > > `DEFINE_PCI_DEVICE_TABLE` to meet kernel coding style guidelines. > > > This issue was reported by checkpatch. > > scripts/checkpatch.pl | 4 ++-- > > Honestly, I prefer the macro -- it stands-out more. Maybe the style > > guidelines and/or checkpatch should change instead? > > The macro is horrid, no other bus has this type of thing just to save a > few characters in typing, so why should PCI be "special" in this regard > anymore? I think it doesn't matter much. The PCI_DEVICE and PCI_VDEVICE macro uses are somewhat similar and are frequently used with PCI_DEVICE_TABLE, so there's some commonality there. The checkpatch message could be made --strict/CHK instead of WARN so most people would never see it. Of course it could be removed altogether too. I don't care. --- (suggested patch is for -next) 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dc72a9b..754fbf2 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3018,8 +3018,8 @@ sub process { # check for uses of DEFINE_PCI_DEVICE_TABLE if ($line =~ /\bDEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=/) { - if (WARN("DEFINE_PCI_DEVICE_TABLE", - "Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) && + if (CHK("DEFINE_PCI_DEVICE_TABLE", + "Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) && $fix) { $fixed[$fixlinenr] =~ s/\b(?:static\s+|)DEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=\s*/static const struct pci_device_id $1\[\] = /; }