* functions named similar (pci_acpi_init) @ 2006-04-27 23:37 Muthu Kumar 2006-04-28 0:00 ` Greg KH 0 siblings, 1 reply; 5+ messages in thread From: Muthu Kumar @ 2006-04-27 23:37 UTC (permalink / raw) To: linux-kernel, greg Hi, While looking at something else, got drifted to looking into initcall<n>.init. I found two instance of pci_acpi_init() function, one in drivers/pci/pci-acpi.c and another in i386/pci/acpi.c. I understand this doesnot cause any problem since they are static, but someone new looking at the code could fall for it? Is it worth changing one of its name or should I just go away :) Muthu. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: functions named similar (pci_acpi_init) 2006-04-27 23:37 functions named similar (pci_acpi_init) Muthu Kumar @ 2006-04-28 0:00 ` Greg KH 2006-04-28 0:27 ` Muthu Kumar 0 siblings, 1 reply; 5+ messages in thread From: Greg KH @ 2006-04-28 0:00 UTC (permalink / raw) To: Muthu Kumar; +Cc: linux-kernel On Thu, Apr 27, 2006 at 04:37:59PM -0700, Muthu Kumar wrote: > Hi, > While looking at something else, got drifted to looking into > initcall<n>.init. I found two instance of pci_acpi_init() function, > one in drivers/pci/pci-acpi.c and another in i386/pci/acpi.c. > I understand this doesnot cause any problem since they are static, but > someone new looking at the code could fall for it? Is it worth > changing one of its name or should I just go away :) If you think changing one of them would help future readers of the code, sure, feel free to send a patch. thanks, greg k-h ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: functions named similar (pci_acpi_init) 2006-04-28 0:00 ` Greg KH @ 2006-04-28 0:27 ` Muthu Kumar 2006-04-28 3:23 ` Greg KH 0 siblings, 1 reply; 5+ messages in thread From: Muthu Kumar @ 2006-04-28 0:27 UTC (permalink / raw) To: Greg KH; +Cc: linux-kernel thanks.. How about the following to make the names consistent with others in that file: diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 6917c6c..d84e25c 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -257,7 +257,7 @@ static int acpi_pci_set_power_state(stru /* ACPI bus type */ -static int pci_acpi_find_device(struct device *dev, acpi_handle *handle) +static int acpi_pci_find_device(struct device *dev, acpi_handle *handle) { struct pci_dev * pci_dev; acpi_integer addr; @@ -271,7 +271,7 @@ static int pci_acpi_find_device(struct d return 0; } -static int pci_acpi_find_root_bridge(struct device *dev, acpi_handle *handle) +static int acpi_pci_find_root_bridge(struct device *dev, acpi_handle *handle) { int num; unsigned int seg, bus; @@ -289,21 +289,21 @@ static int pci_acpi_find_root_bridge(str return 0; } -static struct acpi_bus_type pci_acpi_bus = { +static struct acpi_bus_type acpi_pci_bus = { .bus = &pci_bus_type, - .find_device = pci_acpi_find_device, - .find_bridge = pci_acpi_find_root_bridge, + .find_device = acpi_pci_find_device, + .find_bridge = acpi_pci_find_root_bridge, }; -static int __init pci_acpi_init(void) +static int __init acpi_pci_init(void) { int ret; - ret = register_acpi_bus_type(&pci_acpi_bus); + ret = register_acpi_bus_type(&acpi_pci_bus); if (ret) return 0; platform_pci_choose_state = acpi_pci_choose_state; platform_pci_set_power_state = acpi_pci_set_power_state; return 0; } -arch_initcall(pci_acpi_init); +arch_initcall(acpi_pci_init); On 4/27/06, Greg KH <greg@kroah.com> wrote: > On Thu, Apr 27, 2006 at 04:37:59PM -0700, Muthu Kumar wrote: > > Hi, > > While looking at something else, got drifted to looking into > > initcall<n>.init. I found two instance of pci_acpi_init() function, > > one in drivers/pci/pci-acpi.c and another in i386/pci/acpi.c. > > I understand this doesnot cause any problem since they are static, but > > someone new looking at the code could fall for it? Is it worth > > changing one of its name or should I just go away :) > > If you think changing one of them would help future readers of the code, > sure, feel free to send a patch. > > thanks, > > greg k-h > ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: functions named similar (pci_acpi_init) 2006-04-28 0:27 ` Muthu Kumar @ 2006-04-28 3:23 ` Greg KH 2006-04-28 7:42 ` Muthu Kumar 0 siblings, 1 reply; 5+ messages in thread From: Greg KH @ 2006-04-28 3:23 UTC (permalink / raw) To: Muthu Kumar; +Cc: linux-kernel On Thu, Apr 27, 2006 at 05:27:49PM -0700, Muthu Kumar wrote: > thanks.. How about the following to make the names consistent with others in > that file: Looks good to me. Can you resend it with a proper changelog comments and a Signed-off-by: so I can apply it? thanks, greg k-h ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: functions named similar (pci_acpi_init) 2006-04-28 3:23 ` Greg KH @ 2006-04-28 7:42 ` Muthu Kumar 0 siblings, 0 replies; 5+ messages in thread From: Muthu Kumar @ 2006-04-28 7:42 UTC (permalink / raw) To: Greg KH; +Cc: linux-kernel [PATCH] ACPI PCI: Rename the functions to avoid multiple instances. There were two instances of pci_acpi_init(), one in drivers/pci/pci-acpi.c and another in arch/i386/pci/acpi.c. Rename the one in pci-acpi.c and make it consistent with other names in the same file. Signed-off-by: Muthukumar R <muthur@gmail.com> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 6917c6c..d84e25c 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -257,7 +257,7 @@ static int acpi_pci_set_power_state(stru /* ACPI bus type */ -static int pci_acpi_find_device(struct device *dev, acpi_handle *handle) +static int acpi_pci_find_device(struct device *dev, acpi_handle *handle) { struct pci_dev * pci_dev; acpi_integer addr; @@ -271,7 +271,7 @@ static int pci_acpi_find_device(struct d return 0; } -static int pci_acpi_find_root_bridge(struct device *dev, acpi_handle *handle) +static int acpi_pci_find_root_bridge(struct device *dev, acpi_handle *handle) { int num; unsigned int seg, bus; @@ -289,21 +289,21 @@ static int pci_acpi_find_root_bridge(str return 0; } -static struct acpi_bus_type pci_acpi_bus = { +static struct acpi_bus_type acpi_pci_bus = { .bus = &pci_bus_type, - .find_device = pci_acpi_find_device, - .find_bridge = pci_acpi_find_root_bridge, + .find_device = acpi_pci_find_device, + .find_bridge = acpi_pci_find_root_bridge, }; -static int __init pci_acpi_init(void) +static int __init acpi_pci_init(void) { int ret; - ret = register_acpi_bus_type(&pci_acpi_bus); + ret = register_acpi_bus_type(&acpi_pci_bus); if (ret) return 0; platform_pci_choose_state = acpi_pci_choose_state; platform_pci_set_power_state = acpi_pci_set_power_state; return 0; } -arch_initcall(pci_acpi_init); +arch_initcall(acpi_pci_init); On 4/27/06, Greg KH <greg@kroah.com> wrote: > On Thu, Apr 27, 2006 at 05:27:49PM -0700, Muthu Kumar wrote: > > thanks.. How about the following to make the names consistent with others in > > that file: > > Looks good to me. Can you resend it with a proper changelog comments > and a Signed-off-by: so I can apply it? > > thanks, > > greg k-h > ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-04-28 7:42 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-04-27 23:37 functions named similar (pci_acpi_init) Muthu Kumar 2006-04-28 0:00 ` Greg KH 2006-04-28 0:27 ` Muthu Kumar 2006-04-28 3:23 ` Greg KH 2006-04-28 7:42 ` Muthu Kumar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox