Received: by 10.223.164.221 with SMTP id h29csp3171306wrb; Fri, 3 Nov 2017 02:58:08 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RxfjVWT3mqMWMqwaAWhc64tEAwRxSSIETC9gHqD7IAW6rj5Ri9W2nKeHvHlKVHY0rwgrBO X-Received: by 10.99.164.18 with SMTP id c18mr6557642pgf.167.1509703087900; Fri, 03 Nov 2017 02:58:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509703087; cv=none; d=google.com; s=arc-20160816; b=sqAY76CIsIj2wVhu1QOal6dEt3kmuyPouZdcSNDQt7ancuZa45a+0/zsf03z3RRUbX 4C7HcNtSBANoDauuXvXcirKj1kfx30kM1xo0+2qkxtrd5kl+777RGj8lY7we6yrtn1yw EadoVeuaT2ozIJZNgtGrFGW6ZJeBd/Vscb+3Not0kynKiu8H03fmaojgiANn0mVVvvWj j54z4vQStILVcJnpjyTfySF0s6AQhPkzUC90UfA6rXfjy55m7ldAzp0BxbbdGwu3e3nH 7+dF6Ct9pPmXx5aZ4fRj8U+otB+07OsLK9wktGLrIkis7S5D99FhPu33ahCe10wnwUuL 9HZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=pkL1okPnbXWc3N07clDV7eOBNvv2NZAqD8reObbS2s8=; b=UzQvA7zejp6/wxdA3j7ri+7wW3UIfApAE/zX0zHkGF+L3Zt9ARVh2zaYgLD1Mvv5RL hNjYoK8uBvPsvDgyOSCO0kEIC7GhwH6Bm78OoJ+nXsqR9m3o0ZKX/glQ1xK9G/8wzaiI MBYpVfftTtkF3c4exDghM8okWzTNwIYHcf4MnVySn1C2uM/E9vNDlgQ2fAhS/UDkDmNo 8dg6rXOOif5NOrn2GcKtb/khq5SIj43Q6wV/7SmtGKQG1WbRSvbS7i358h2BbFt4rdLY UJa3z7giMIr8J1hl1RT59CxrbQeFCa4axBPH2rDyXENMD2EqZ7Faj/udYpnHa/ilxYZX /9dQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19si5490510pgn.751.2017.11.03.02.57.54; Fri, 03 Nov 2017 02:58:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755808AbdKCJ5Q (ORCPT + 97 others); Fri, 3 Nov 2017 05:57:16 -0400 Received: from bastet.se.axis.com ([195.60.68.11]:54118 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751623AbdKCJ5O (ORCPT ); Fri, 3 Nov 2017 05:57:14 -0400 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id 299ED18963; Fri, 3 Nov 2017 10:57:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id xl6XKOunxKIJ; Fri, 3 Nov 2017 10:57:10 +0100 (CET) Received: from boulder03.se.axis.com (boulder03.se.axis.com [10.0.8.17]) by bastet.se.axis.com (Postfix) with ESMTPS id 974841886E; Fri, 3 Nov 2017 10:57:10 +0100 (CET) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 856AE1E07D; Fri, 3 Nov 2017 10:57:10 +0100 (CET) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 778131E07A; Fri, 3 Nov 2017 10:57:10 +0100 (CET) Received: from seth.se.axis.com (unknown [10.0.2.172]) by boulder03.se.axis.com (Postfix) with ESMTP; Fri, 3 Nov 2017 10:57:10 +0100 (CET) Received: from XBOX02.axis.com (xbox02.axis.com [10.0.5.16]) by seth.se.axis.com (Postfix) with ESMTP id 6AE45251B; Fri, 3 Nov 2017 10:57:10 +0100 (CET) Received: from [10.88.4.10] (10.0.5.60) by XBOX02.axis.com (10.0.5.16) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 3 Nov 2017 10:57:10 +0100 Subject: Re: [PATCH v3 14/17] PCI: dwc: artpec6: Add support for endpoint mode To: Arnd Bergmann CC: Bjorn Helgaas , Jesper Nilsson , Kishon Vijay Abraham I , Jingoo Han , Shawn Guo , Peter Robinson , Xiaowei Song , linux-pci , Linux Kernel Mailing List , References: <20171031223936.27549-1-niklas.cassel@axis.com> <20171031223936.27549-15-niklas.cassel@axis.com> From: Niklas Cassel Message-ID: <5a8c7aaf-552c-7170-2a36-13b50168a9cc@axis.com> Date: Fri, 3 Nov 2017 10:56:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: XBOX03.axis.com (10.0.5.17) To XBOX02.axis.com (10.0.5.16) X-TM-AS-GCONF: 00 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/02/2017 10:13 AM, Arnd Bergmann wrote: > On Tue, Oct 31, 2017 at 11:39 PM, Niklas Cassel wrote: >> Signed-off-by: Niklas Cassel > > It seems like you are missing a changelog text. Please explain what > your work is good for > in any patch you send. You are correct, this patch is missing a changelog text. I will send a V4 of the patch series for this. > >> V3: >> * Removed ifdefs around match table and match table data. >> * Removed ifdefs in probe, use dummy implementations instead. > > I think there is room for more of the same ;-) > >> >> +#ifdef CONFIG_PCIE_ARTPEC6_HOST >> static void artpec6_pcie_enable_interrupts(struct artpec6_pcie *artpec6_pcie) >> { >> struct dw_pcie *pci = artpec6_pcie->pci; >> @@ -231,11 +257,92 @@ static int artpec6_add_pcie_port(struct artpec6_pcie *artpec6_pcie, >> >> return 0; >> } >> +#else >> +static inline int artpec6_add_pcie_port(struct artpec6_pcie *artpec6_pcie, >> + struct platform_device *pdev) >> +{ >> + return -ENODEV; >> +} >> +#endif > > > Can you try replacing the #ifdef with > > > if (!IS_ENABLED(CONFIG_PCIE_ARTPEC6_HOST)) > return -ENODEV; > > at the start of artpec6_pcie_enable_interrupts? I think that would improve > readability here. > artpec6_pcie_enable_interrupts is a void function, so I guess that you meant at the start of artpec6_add_pcie_port. That would not really help since artpec6_add_pcie_port calls artpec6_pcie_msi_handler, and uses artpec6_pcie_host_ops, which is still inside the CONFIG_PCIE_ARTPEC6_HOST ifdef block. Please note that there are several functions, as well as artpec6_pcie_host_ops inside the CONFIG_PCIE_ARTPEC6_HOST ifdef block. The reason for this is because Bjorn was surprised that this driver at V1 didn't have any ifdefs, even though it supports two different modes: HOST and EP. I suspected that his reasoning was that if you compile the driver with only one of the modes, it is wasteful to compile and include the functions that belong to the mode that we are not using in the vmlinux. >> +static int artpec6_add_pcie_ep(struct artpec6_pcie *artpec6_pcie, >> + struct platform_device *pdev) >> +{ >> + int ret; >> + struct dw_pcie_ep *ep; >> + struct resource *res; >> + struct device *dev = &pdev->dev; >> + struct dw_pcie *pci = artpec6_pcie->pci; > > The same trick should work here with the other symbol. While artpec6_add_pcie_ep doesn't call any other function in this file, it does use pcie_ep_ops, which does reference other functions in this file (which are inside the ifdef block). Regards, Niklas From 1582945070761926422@xxx Thu Nov 02 09:14:18 +0000 2017 X-GM-THRID: 1582814679884309053 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread