From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753844AbbDHBTX (ORCPT ); Tue, 7 Apr 2015 21:19:23 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:7783 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753184AbbDHBTU (ORCPT ); Tue, 7 Apr 2015 21:19:20 -0400 Message-ID: <552481F8.1090308@huawei.com> Date: Wed, 8 Apr 2015 09:18:48 +0800 From: Yijing Wang User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Bjorn Helgaas CC: Jiang Liu , , Yinghai Lu , , Marc Zyngier , , Russell King , , , Thomas Gleixner , Benjamin Herrenschmidt , Rusty Russell , Tony Luck , , "David S. Miller" , "Guan Xuetao" , , , Liviu Dudau , "Arnd Bergmann" , Geert Uytterhoeven Subject: Re: [PATCH v9 06/30] PCI: Separate pci_host_bridge creation out of pci_create_root_bus() References: <1428053164-28277-1-git-send-email-wangyijing@huawei.com> <1428053164-28277-8-git-send-email-wangyijing@huawei.com> <20150407213839.GJ10892@google.com> In-Reply-To: <20150407213839.GJ10892@google.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.27.212] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> + /* >> + * If support CONFIG_PCI_DOMAINS_GENERIC, use >> + * pci_host_assign_domain_nr() to update domain >> + * number. >> + */ >> + host->domain = domain; >> + pci_host_assign_domain_nr(host); > > I think it's a bit confusing that there's another "host->domain =" > assignment buried inside pci_host_assign_domain_nr(), so the first > assignment is overwritten when CONFIG_PCI_DOMAINS_GENERIC is set. > > Can you do something like this instead: > > int pci_host_assign_domain_nr(struct pci_host_bridge *host, int domain) > { > #ifdef CONFIG_PCI_DOMAINS_GENERIC > host->domain = pci_assign_domain_nr(host->dev.parent); > #else > host->domain = domain; > #endif > } > > Then the alternatives (CONFIG_PCI_DOMAINS_GENERIC=y and > CONFIG_PCI_DOMAINS_GENERIC being unset) are close together and right at the > #ifdef CONFIG_PCI_DOMAINS_GENERIC, so no extra comments are needed. OK, I would use #ifdef to update pci_host_assign_domain_nr(), and I would drop the last patch [PATCH v9 30/30] PCI: Clean up CONFIG_PCI_DOMAINS_GENERIC. Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga02-in.huawei.com ([119.145.14.65]:7783 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753184AbbDHBTU (ORCPT ); Tue, 7 Apr 2015 21:19:20 -0400 Message-ID: <552481F8.1090308@huawei.com> Date: Wed, 8 Apr 2015 09:18:48 +0800 From: Yijing Wang MIME-Version: 1.0 To: Bjorn Helgaas CC: Jiang Liu , , Yinghai Lu , , Marc Zyngier , , Russell King , , , Thomas Gleixner , Benjamin Herrenschmidt , Rusty Russell , Tony Luck , , "David S. Miller" , "Guan Xuetao" , , , Liviu Dudau , "Arnd Bergmann" , Geert Uytterhoeven Subject: Re: [PATCH v9 06/30] PCI: Separate pci_host_bridge creation out of pci_create_root_bus() References: <1428053164-28277-1-git-send-email-wangyijing@huawei.com> <1428053164-28277-8-git-send-email-wangyijing@huawei.com> <20150407213839.GJ10892@google.com> In-Reply-To: <20150407213839.GJ10892@google.com> Content-Type: text/plain; charset="ISO-8859-1" Sender: linux-pci-owner@vger.kernel.org List-ID: >> + /* >> + * If support CONFIG_PCI_DOMAINS_GENERIC, use >> + * pci_host_assign_domain_nr() to update domain >> + * number. >> + */ >> + host->domain = domain; >> + pci_host_assign_domain_nr(host); > > I think it's a bit confusing that there's another "host->domain =" > assignment buried inside pci_host_assign_domain_nr(), so the first > assignment is overwritten when CONFIG_PCI_DOMAINS_GENERIC is set. > > Can you do something like this instead: > > int pci_host_assign_domain_nr(struct pci_host_bridge *host, int domain) > { > #ifdef CONFIG_PCI_DOMAINS_GENERIC > host->domain = pci_assign_domain_nr(host->dev.parent); > #else > host->domain = domain; > #endif > } > > Then the alternatives (CONFIG_PCI_DOMAINS_GENERIC=y and > CONFIG_PCI_DOMAINS_GENERIC being unset) are close together and right at the > #ifdef CONFIG_PCI_DOMAINS_GENERIC, so no extra comments are needed. OK, I would use #ifdef to update pci_host_assign_domain_nr(), and I would drop the last patch [PATCH v9 30/30] PCI: Clean up CONFIG_PCI_DOMAINS_GENERIC. Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 From: wangyijing@huawei.com (Yijing Wang) Date: Wed, 8 Apr 2015 09:18:48 +0800 Subject: [PATCH v9 06/30] PCI: Separate pci_host_bridge creation out of pci_create_root_bus() In-Reply-To: <20150407213839.GJ10892@google.com> References: <1428053164-28277-1-git-send-email-wangyijing@huawei.com> <1428053164-28277-8-git-send-email-wangyijing@huawei.com> <20150407213839.GJ10892@google.com> Message-ID: <552481F8.1090308@huawei.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org >> + /* >> + * If support CONFIG_PCI_DOMAINS_GENERIC, use >> + * pci_host_assign_domain_nr() to update domain >> + * number. >> + */ >> + host->domain = domain; >> + pci_host_assign_domain_nr(host); > > I think it's a bit confusing that there's another "host->domain =" > assignment buried inside pci_host_assign_domain_nr(), so the first > assignment is overwritten when CONFIG_PCI_DOMAINS_GENERIC is set. > > Can you do something like this instead: > > int pci_host_assign_domain_nr(struct pci_host_bridge *host, int domain) > { > #ifdef CONFIG_PCI_DOMAINS_GENERIC > host->domain = pci_assign_domain_nr(host->dev.parent); > #else > host->domain = domain; > #endif > } > > Then the alternatives (CONFIG_PCI_DOMAINS_GENERIC=y and > CONFIG_PCI_DOMAINS_GENERIC being unset) are close together and right at the > #ifdef CONFIG_PCI_DOMAINS_GENERIC, so no extra comments are needed. OK, I would use #ifdef to update pci_host_assign_domain_nr(), and I would drop the last patch [PATCH v9 30/30] PCI: Clean up CONFIG_PCI_DOMAINS_GENERIC. Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Date: Wed, 08 Apr 2015 01:18:48 +0000 Subject: Re: [PATCH v9 06/30] PCI: Separate pci_host_bridge creation out of pci_create_root_bus() Message-Id: <552481F8.1090308@huawei.com> List-Id: References: <1428053164-28277-1-git-send-email-wangyijing@huawei.com> <1428053164-28277-8-git-send-email-wangyijing@huawei.com> <20150407213839.GJ10892@google.com> In-Reply-To: <20150407213839.GJ10892@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Bjorn Helgaas Cc: Jiang Liu , linux-pci@vger.kernel.org, Yinghai Lu , linux-kernel@vger.kernel.org, Marc Zyngier , linux-arm-kernel@lists.infradead.org, Russell King , dja@axtens.net, x86@kernel.org, Thomas Gleixner , Benjamin Herrenschmidt , Rusty Russell , Tony Luck , linux-ia64@vger.kernel.org, "David S. Miller" , Guan Xuetao , linux-alpha@vger.kernel.org, linux-m68k@vger.kernel.org, Liviu Dudau , Arnd Bergmann , Geert Uytterhoeven >> + /* >> + * If support CONFIG_PCI_DOMAINS_GENERIC, use >> + * pci_host_assign_domain_nr() to update domain >> + * number. >> + */ >> + host->domain = domain; >> + pci_host_assign_domain_nr(host); > > I think it's a bit confusing that there's another "host->domain =" > assignment buried inside pci_host_assign_domain_nr(), so the first > assignment is overwritten when CONFIG_PCI_DOMAINS_GENERIC is set. > > Can you do something like this instead: > > int pci_host_assign_domain_nr(struct pci_host_bridge *host, int domain) > { > #ifdef CONFIG_PCI_DOMAINS_GENERIC > host->domain = pci_assign_domain_nr(host->dev.parent); > #else > host->domain = domain; > #endif > } > > Then the alternatives (CONFIG_PCI_DOMAINS_GENERIC=y and > CONFIG_PCI_DOMAINS_GENERIC being unset) are close together and right at the > #ifdef CONFIG_PCI_DOMAINS_GENERIC, so no extra comments are needed. OK, I would use #ifdef to update pci_host_assign_domain_nr(), and I would drop the last patch [PATCH v9 30/30] PCI: Clean up CONFIG_PCI_DOMAINS_GENERIC. Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Subject: Re: [PATCH v9 06/30] PCI: Separate pci_host_bridge creation out of pci_create_root_bus() Date: Wed, 8 Apr 2015 09:18:48 +0800 Message-ID: <552481F8.1090308@huawei.com> References: <1428053164-28277-1-git-send-email-wangyijing@huawei.com> <1428053164-28277-8-git-send-email-wangyijing@huawei.com> <20150407213839.GJ10892@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150407213839.GJ10892@google.com> Sender: linux-alpha-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Bjorn Helgaas Cc: Jiang Liu , linux-pci@vger.kernel.org, Yinghai Lu , linux-kernel@vger.kernel.org, Marc Zyngier , linux-arm-kernel@lists.infradead.org, Russell King , dja@axtens.net, x86@kernel.org, Thomas Gleixner , Benjamin Herrenschmidt , Rusty Russell , Tony Luck , linux-ia64@vger.kernel.org, "David S. Miller" , Guan Xuetao , linux-alpha@vger.kernel.org, linux-m68k@lists.linux-m68k.org, Liviu Dudau , Arnd Bergmann , Geert Uytterhoeven >> + /* >> + * If support CONFIG_PCI_DOMAINS_GENERIC, use >> + * pci_host_assign_domain_nr() to update domain >> + * number. >> + */ >> + host->domain = domain; >> + pci_host_assign_domain_nr(host); > > I think it's a bit confusing that there's another "host->domain =" > assignment buried inside pci_host_assign_domain_nr(), so the first > assignment is overwritten when CONFIG_PCI_DOMAINS_GENERIC is set. > > Can you do something like this instead: > > int pci_host_assign_domain_nr(struct pci_host_bridge *host, int domain) > { > #ifdef CONFIG_PCI_DOMAINS_GENERIC > host->domain = pci_assign_domain_nr(host->dev.parent); > #else > host->domain = domain; > #endif > } > > Then the alternatives (CONFIG_PCI_DOMAINS_GENERIC=y and > CONFIG_PCI_DOMAINS_GENERIC being unset) are close together and right at the > #ifdef CONFIG_PCI_DOMAINS_GENERIC, so no extra comments are needed. OK, I would use #ifdef to update pci_host_assign_domain_nr(), and I would drop the last patch [PATCH v9 30/30] PCI: Clean up CONFIG_PCI_DOMAINS_GENERIC. Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing