From patchwork Wed Jun 17 13:30:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 6626011 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5AA109F399 for ; Wed, 17 Jun 2015 13:34:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C31C420892 for ; Wed, 17 Jun 2015 13:34:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3082D2086D for ; Wed, 17 Jun 2015 13:34:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z5DRy-0005f6-Ht; Wed, 17 Jun 2015 13:32:18 +0000 Received: from mail-bl2on0096.outbound.protection.outlook.com ([65.55.169.96] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z5DRs-0004Yj-99 for linux-arm-kernel@lists.infradead.org; Wed, 17 Jun 2015 13:32:16 +0000 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from rric.localhost (78.53.81.95) by BLUPR0701MB1603.namprd07.prod.outlook.com (10.163.84.152) with Microsoft SMTP Server (TLS) id 15.1.190.14; Wed, 17 Jun 2015 13:30:14 +0000 Date: Wed, 17 Jun 2015 15:30:02 +0200 From: Robert Richter To: Tejun Heo , Jiang Liu Subject: [PATCH v2] ahci, msix: Fix build error for !PCI_MSI Message-ID: <20150617133002.GW10428@rric.localhost> References: <1433526566-21136-1-git-send-email-rric@kernel.org> <20150616132434.GO10428@rric.localhost> <20150616201341.GD22637@mtj.duckdns.org> <20150617084852.GL4914@rric.localhost> <5581379C.3090607@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5581379C.3090607@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [78.53.81.95] X-ClientProxiedBy: VI1PR05CA0040.eurprd05.prod.outlook.com (25.162.33.178) To BLUPR0701MB1603.namprd07.prod.outlook.com (25.163.84.152) X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1603; 2:wiqTuDBdaPtEsdEPyn0JfBRgEOr/QwIcDFN8TQd8+ETYbzVgqIuA/StHcURvfncR; 2:FJNqV0K0Wg8fbK+p1J/90mopfnCkVhRhvbIDMafikDtCm5HLPEKV6Xj/0kjetRjYofIRnRCLy0yf6CvExJ2y7coZ0SyaVqLqpNhP9+3of1r1zyGkR5RJTmKeSbEAqAEJCDqGiZ71AFzQWASSLK3Bfw==; 6:y0Lc1tH7HB6/THNUvDphGeggjkLFTQL2gd4oRz20v79rf10ZhryBJ5lJn4ku6mVR0vjgquYIN5QFdY4RGv5dIiFq92TMXWM0G7NZzvJkRP68/bpbpcYTvQghk6nzapP2gmX/G8QaWK29DDxgmhl296YEeAVrgq3DVNJ/TFKmDDB/g603G8u5loRV1Gz43k5qNQDOKY1VNGKo8LbAGLWrwvhSPawy3nEIBSjUkwE/G9IduTjJuZTZDdZVTtDO8FvXB6d0V8k5lf0Z60CgBLXPxZywDVFjgtN+iz2iyVhVsNJi9ePpJMGiD7wN+wD7YVKnGvO9+ITo976zv7c/oDd4s6j9lonViWuzI0Y9Xzr1BHRaUZkNxzsVsnf/BBNKu0he8Objj4ayX3pPnj/g4m2ijgMtjYFOlJSWdgpyIlaV6U1wgMK6F926xEBElPMyeT3VkWId9W4Pdo67Hg+n1I2SE0+kgp7ogLuyYTLuHAEJrTgC81kC4/TIgPRxX/xSUXZFbx4QuJ5g5J02MNGUGDUc9q2AAItSrQWHCaq8rADL9R4/yCuWXOWXi9ObSOynkA2p3AqnRgMTPTuI/lAghGN5piqQKmFXNkiDFfSDCH7Ejcc= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1603; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(520003)(3002001); SRVR:BLUPR0701MB1603; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1603; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1603; 3:oVN6f98Ptyv0t+Bq5c0V9hzGcANXWRUtPjgt3U85BWL8ZY3KsREuJ9QzqVvvz62o1/VUTrOSQSCToKyR8AA92QqrKFPxsGDsNauLqhroFtcl8Wh4AithJAR7Jz/4yio2fBVTBtf/onMY6biNAEuGtnCPbwBcsJr8FR180gZej0vJuTaF+DnXmvaHTTs8ozmSHKh5JEtqmsDucYD2nHWu5q3ImhnPZ54S1ihGnfHu8aMFunGM6kqA8CL7uZyyPQFqnbIc37eeUMgDWYAVDK/eJ47Oa1v7Zb0xmLG7yJ4W0cwXTHNjkp6vAbfkNB9PZGzN X-Forefront-PRVS: 0610D16BBE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(51704005)(24454002)(479174004)(33656002)(76176999)(62966003)(77156002)(50986999)(5001770100001)(189998001)(54356999)(122386002)(23676002)(5001960100002)(229853001)(83506001)(92566002)(4001350100001)(40100003)(47776003)(2950100001)(66066001)(86362001)(575784001)(76506005)(42186005)(50466002)(77096005)(93886004)(46102003)(87976001)(19580405001)(19580395003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1603; H:rric.localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1603; 9:PuY2Em03sYfItvxoU2tQzzVxNUG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zkPtM7yPI8w==; 10:NeCItvwaBs8ta+dUDcoAOy5JKno9EfX2CRvDW9e+VlRcnxwKtocXu1gPKXvigdq2XI5/prcM5szQT52VOR6LkSP1rozrJ6Lg1rw73i4z6Og=; 6:WnJWbUswj9MHEIZYPMawjMu0kwtO/rUvOdEZb/8Sic3+/e5nnbaRlDc6yQHkg0Pg X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2015 13:30:14.4108 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1603 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150617_063212_502394_B5066DDE X-CRM114-Status: GOOD ( 17.46 ) X-Spam-Score: -0.0 (/) Cc: Sunil Goutham , Robert Richter , linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, kbuild-all@01.org, kbuild test robot , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 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 Tejun, Gerry, On 17.06.15 17:02:20, Jiang Liu wrote: > On 2015/6/17 16:48, Robert Richter wrote: > > static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry) > > { > > +#ifdef CONFIG_PCI_MSI > > struct msi_desc *desc; > > > > list_for_each_entry(desc, &dev->msi_list, list) { > > if (desc->msi_attrib.entry_nr == entry) > > return desc; > > } > > - > > +#endif > Hi Robert, > While at it, could you please help to use for_each_pci_msi_entry() > from include/linux/msi.h instead of hard-coding? We are trying to refine > the msi_list related code, > so we don't need to touch this code again later. While looking into this I realized the code can be much more simplified so that the desc lookup function can be removed at all. See below. Sorry for the patch noise. -Robert From e43b79f0afd794d3e37ec0922c75e44b1c3f2e22 Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Wed, 17 Jun 2015 10:33:22 +0200 Subject: [PATCH v2] ahci, msix: Fix build error for !PCI_MSI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It turned out the irq vector of the msix can be obtained from struct msix_entry. This makes the lookup function for msi_desc obsolete. This fixes a build error if PCI_MSI is unset: drivers/ata/ahci.c: In function ‘msix_get_desc’: drivers/ata/ahci.c:1210:2: error: ‘struct pci_dev’ has no member named ‘msi_list’ Catched by Fengguang's build bot. Reported-by: kbuild test robot Signed-off-by: Robert Richter --- drivers/ata/ahci.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index bdedaa4f9d7b..c478a40e32c6 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1203,18 +1203,6 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host) {} #endif -static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry) -{ - struct msi_desc *desc; - - list_for_each_entry(desc, &dev->msi_list, list) { - if (desc->msi_attrib.entry_nr == entry) - return desc; - } - - return NULL; -} - /* * ahci_init_msix() only implements single MSI-X support, not multiple * MSI-X per-port interrupts. This is needed for host controllers that only @@ -1223,7 +1211,6 @@ static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry) static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports, struct ahci_host_priv *hpriv) { - struct msi_desc *desc; int rc, nvec; struct msix_entry entry = {}; @@ -1248,13 +1235,7 @@ static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports, if (rc < 0) goto fail; - desc = msix_get_desc(pdev, 0); /* first entry */ - if (!desc) { - rc = -EINVAL; - goto fail; - } - - hpriv->irq = desc->irq; + hpriv->irq = entry.vector; return 1; fail: