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 Content-Length: 1366 Lines: 49 >> + /* >> + * 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 -- 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/