From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755483AbbCMDTr (ORCPT ); Thu, 12 Mar 2015 23:19:47 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:18623 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752645AbbCMDTn (ORCPT ); Thu, 12 Mar 2015 23:19:43 -0400 Message-ID: <55025730.40504@huawei.com> Date: Fri, 13 Mar 2015 11:19:12 +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 v6 06/30] PCI: Combine PCI domain and bus number in u32 arg References: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> <1425868467-9667-7-git-send-email-wangyijing@huawei.com> <20150312012946.GA10949@google.com> <55018330.5050002@huawei.com> <20150312194927.GC7346@google.com> In-Reply-To: <20150312194927.GC7346@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 >> struct pci_scan_info { >> int bus; >> struct device *parent; >> struct pci_ops *ops; >> void *sysdata; >> struct list_head *resource; >> int domain; >> struct pci_host_bridge_ops; >> } >> >> Do you like this one or keep it like now ? >> >> pci_scan_root_bus(struct device *parent, int domain, int bus, >> struct pci_ops *ops, void *sysdata, struct list_head *resources, struct pci_host_bridge_ops *ops) > > I don't think reducing the number of arguments is a good argument for > squashing some of them together. > > I don't really want to add a structure like that because it adds management > complexity for all the callers because it contains per-bridge things (bus, > parent, domain, resource, sysdata). Things like struct pci_ops and struct > pci_host_bridge_ops are much simpler because drivers can statically > allocate a single copy and use it for multiple devices. > > I think it might make sense to put the struct pci_ops pointer inside struct > pci_host_bridge_ops. That would get rid of one of the arguments. > > You might also be able to get rid of the "bus" argument, since the caller > should be passing an IORESOURCE_BUS resource in the resource list, and > "bus" should be the same as res->start. I think this make sense, I will try to find a better solution. Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga01-in.huawei.com ([58.251.152.64]:18623 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752645AbbCMDTn (ORCPT ); Thu, 12 Mar 2015 23:19:43 -0400 Message-ID: <55025730.40504@huawei.com> Date: Fri, 13 Mar 2015 11:19:12 +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 v6 06/30] PCI: Combine PCI domain and bus number in u32 arg References: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> <1425868467-9667-7-git-send-email-wangyijing@huawei.com> <20150312012946.GA10949@google.com> <55018330.5050002@huawei.com> <20150312194927.GC7346@google.com> In-Reply-To: <20150312194927.GC7346@google.com> Content-Type: text/plain; charset="ISO-8859-1" Sender: linux-pci-owner@vger.kernel.org List-ID: >> struct pci_scan_info { >> int bus; >> struct device *parent; >> struct pci_ops *ops; >> void *sysdata; >> struct list_head *resource; >> int domain; >> struct pci_host_bridge_ops; >> } >> >> Do you like this one or keep it like now ? >> >> pci_scan_root_bus(struct device *parent, int domain, int bus, >> struct pci_ops *ops, void *sysdata, struct list_head *resources, struct pci_host_bridge_ops *ops) > > I don't think reducing the number of arguments is a good argument for > squashing some of them together. > > I don't really want to add a structure like that because it adds management > complexity for all the callers because it contains per-bridge things (bus, > parent, domain, resource, sysdata). Things like struct pci_ops and struct > pci_host_bridge_ops are much simpler because drivers can statically > allocate a single copy and use it for multiple devices. > > I think it might make sense to put the struct pci_ops pointer inside struct > pci_host_bridge_ops. That would get rid of one of the arguments. > > You might also be able to get rid of the "bus" argument, since the caller > should be passing an IORESOURCE_BUS resource in the resource list, and > "bus" should be the same as res->start. I think this make sense, I will try to find a better solution. Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 From: wangyijing@huawei.com (Yijing Wang) Date: Fri, 13 Mar 2015 11:19:12 +0800 Subject: [PATCH v6 06/30] PCI: Combine PCI domain and bus number in u32 arg In-Reply-To: <20150312194927.GC7346@google.com> References: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> <1425868467-9667-7-git-send-email-wangyijing@huawei.com> <20150312012946.GA10949@google.com> <55018330.5050002@huawei.com> <20150312194927.GC7346@google.com> Message-ID: <55025730.40504@huawei.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org >> struct pci_scan_info { >> int bus; >> struct device *parent; >> struct pci_ops *ops; >> void *sysdata; >> struct list_head *resource; >> int domain; >> struct pci_host_bridge_ops; >> } >> >> Do you like this one or keep it like now ? >> >> pci_scan_root_bus(struct device *parent, int domain, int bus, >> struct pci_ops *ops, void *sysdata, struct list_head *resources, struct pci_host_bridge_ops *ops) > > I don't think reducing the number of arguments is a good argument for > squashing some of them together. > > I don't really want to add a structure like that because it adds management > complexity for all the callers because it contains per-bridge things (bus, > parent, domain, resource, sysdata). Things like struct pci_ops and struct > pci_host_bridge_ops are much simpler because drivers can statically > allocate a single copy and use it for multiple devices. > > I think it might make sense to put the struct pci_ops pointer inside struct > pci_host_bridge_ops. That would get rid of one of the arguments. > > You might also be able to get rid of the "bus" argument, since the caller > should be passing an IORESOURCE_BUS resource in the resource list, and > "bus" should be the same as res->start. I think this make sense, I will try to find a better solution. Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Date: Fri, 13 Mar 2015 03:19:12 +0000 Subject: Re: [PATCH v6 06/30] PCI: Combine PCI domain and bus number in u32 arg Message-Id: <55025730.40504@huawei.com> List-Id: References: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> <1425868467-9667-7-git-send-email-wangyijing@huawei.com> <20150312012946.GA10949@google.com> <55018330.5050002@huawei.com> <20150312194927.GC7346@google.com> In-Reply-To: <20150312194927.GC7346@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 , 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 >> struct pci_scan_info { >> int bus; >> struct device *parent; >> struct pci_ops *ops; >> void *sysdata; >> struct list_head *resource; >> int domain; >> struct pci_host_bridge_ops; >> } >> >> Do you like this one or keep it like now ? >> >> pci_scan_root_bus(struct device *parent, int domain, int bus, >> struct pci_ops *ops, void *sysdata, struct list_head *resources, struct pci_host_bridge_ops *ops) > > I don't think reducing the number of arguments is a good argument for > squashing some of them together. > > I don't really want to add a structure like that because it adds management > complexity for all the callers because it contains per-bridge things (bus, > parent, domain, resource, sysdata). Things like struct pci_ops and struct > pci_host_bridge_ops are much simpler because drivers can statically > allocate a single copy and use it for multiple devices. > > I think it might make sense to put the struct pci_ops pointer inside struct > pci_host_bridge_ops. That would get rid of one of the arguments. > > You might also be able to get rid of the "bus" argument, since the caller > should be passing an IORESOURCE_BUS resource in the resource list, and > "bus" should be the same as res->start. I think this make sense, I will try to find a better solution. Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Subject: Re: [PATCH v6 06/30] PCI: Combine PCI domain and bus number in u32 arg Date: Fri, 13 Mar 2015 11:19:12 +0800 Message-ID: <55025730.40504@huawei.com> References: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> <1425868467-9667-7-git-send-email-wangyijing@huawei.com> <20150312012946.GA10949@google.com> <55018330.5050002@huawei.com> <20150312194927.GC7346@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150312194927.GC7346@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 , 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 >> struct pci_scan_info { >> int bus; >> struct device *parent; >> struct pci_ops *ops; >> void *sysdata; >> struct list_head *resource; >> int domain; >> struct pci_host_bridge_ops; >> } >> >> Do you like this one or keep it like now ? >> >> pci_scan_root_bus(struct device *parent, int domain, int bus, >> struct pci_ops *ops, void *sysdata, struct list_head *resources, struct pci_host_bridge_ops *ops) > > I don't think reducing the number of arguments is a good argument for > squashing some of them together. > > I don't really want to add a structure like that because it adds management > complexity for all the callers because it contains per-bridge things (bus, > parent, domain, resource, sysdata). Things like struct pci_ops and struct > pci_host_bridge_ops are much simpler because drivers can statically > allocate a single copy and use it for multiple devices. > > I think it might make sense to put the struct pci_ops pointer inside struct > pci_host_bridge_ops. That would get rid of one of the arguments. > > You might also be able to get rid of the "bus" argument, since the caller > should be passing an IORESOURCE_BUS resource in the resource list, and > "bus" should be the same as res->start. I think this make sense, I will try to find a better solution. Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing