public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* incompatible struct pci_root_info?
@ 2011-05-14 17:02 Németh Márton
  2011-05-14 18:07 ` H. Peter Anvin
  0 siblings, 1 reply; 3+ messages in thread
From: Németh Márton @ 2011-05-14 17:02 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Tony Luck,
	Fenghua Yu, linux-ia64
  Cc: Julia Lawall, LKML

Hello,

I have found struct pci_root_info declaration at three different places in Linux
kernel 2.6.39-rc6. Two of them are in arch/x86 and one of them is in arch/ia64.

arch/x86/pci/bus_numa.h:8:

	struct pci_root_info {
		char name[12];
		unsigned int res_num;
		struct resource res[RES_NUM];
		int bus_min;
		int bus_max;
		int node;
		int link;
	};

arch/x86/pci/acpi.c:10:

	struct pci_root_info {
		struct acpi_device *bridge;
		char *name;
		unsigned int res_num;
		struct resource *res;
		struct pci_bus *bus;
		int busnum;
	};

arch/ia64/pci/pci.c:133:

	struct pci_root_info {
		struct acpi_device *bridge;
		struct pci_controller *controller;
		char *name;
	};

As far as I know it is OK to have different types on different architectures
with the same name. Is there any reason behind having two struct pci_root_info
delcaration in arch/x86?

Regards,

	Márton Németh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: incompatible struct pci_root_info?
  2011-05-14 17:02 incompatible struct pci_root_info? Németh Márton
@ 2011-05-14 18:07 ` H. Peter Anvin
  2011-05-15 19:09   ` [PATCH] x86 pci acpi: rename struct pci_root_info Németh Márton
  0 siblings, 1 reply; 3+ messages in thread
From: H. Peter Anvin @ 2011-05-14 18:07 UTC (permalink / raw)
  To: Németh Márton
  Cc: Thomas Gleixner, Ingo Molnar, x86, Tony Luck, Fenghua Yu,
	linux-ia64, Julia Lawall, LKML

On 05/14/2011 10:02 AM, Németh Márton wrote:
> 
> As far as I know it is OK to have different types on different architectures
> with the same name. Is there any reason behind having two struct pci_root_info
> delcaration in arch/x86?
> 

It looks like a namespace collision; the same name being used for that
is really two different types.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] x86 pci acpi: rename struct pci_root_info
  2011-05-14 18:07 ` H. Peter Anvin
@ 2011-05-15 19:09   ` Németh Márton
  0 siblings, 0 replies; 3+ messages in thread
From: Németh Márton @ 2011-05-15 19:09 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Thomas Gleixner, Ingo Molnar, x86, Tony Luck, Fenghua Yu,
	linux-ia64, Julia Lawall, LKML

From: Márton Németh <nm127@freemail.hu>

Rename struct pci_root_info to struct acpi_pci_root_info in
arch/x86/pci/acpi.c because there is already a struct
pci_root_info declared in arch/x86/pci/bus_numa.h . They both
belnog to x86 architecture and the two declarations differ,
so after rename each will have a unique name.

Signed-off-by: Márton Németh <nm127@freemail.hu>
---
--- linux-2.6.39-rc7/arch/x86/pci/acpi.c.orig	2011-05-10 04:33:54.000000000 +0200
+++ linux-2.6.39-rc7/arch/x86/pci/acpi.c	2011-05-15 17:02:52.000000000 +0200
@@ -7,7 +7,7 @@
 #include <asm/numa.h>
 #include <asm/pci_x86.h>

-struct pci_root_info {
+struct acpi_pci_root_info {
 	struct acpi_device *bridge;
 	char *name;
 	unsigned int res_num;
@@ -120,7 +120,7 @@ resource_to_addr(struct acpi_resource *r
 static acpi_status
 count_resource(struct acpi_resource *acpi_res, void *data)
 {
-	struct pci_root_info *info = data;
+	struct acpi_pci_root_info *info = data;
 	struct acpi_resource_address64 addr;
 	acpi_status status;

@@ -133,7 +133,7 @@ count_resource(struct acpi_resource *acp
 static acpi_status
 setup_resource(struct acpi_resource *acpi_res, void *data)
 {
-	struct pci_root_info *info = data;
+	struct acpi_pci_root_info *info = data;
 	struct resource *res;
 	struct acpi_resource_address64 addr;
 	acpi_status status;
@@ -188,7 +188,7 @@ static bool resource_contains(struct res
 	return false;
 }

-static void coalesce_windows(struct pci_root_info *info, int type)
+static void coalesce_windows(struct acpi_pci_root_info *info, int type)
 {
 	int i, j;
 	struct resource *res1, *res2;
@@ -223,7 +223,7 @@ static void coalesce_windows(struct pci_
 	}
 }

-static void add_resources(struct pci_root_info *info)
+static void add_resources(struct acpi_pci_root_info *info)
 {
 	int i;
 	struct resource *res, *root, *conflict;
@@ -259,7 +259,7 @@ static void
 get_current_resources(struct acpi_device *device, int busnum,
 			int domain, struct pci_bus *bus)
 {
-	struct pci_root_info info;
+	struct acpi_pci_root_info info;
 	size_t size;

 	if (pci_use_crs)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-15 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-14 17:02 incompatible struct pci_root_info? Németh Márton
2011-05-14 18:07 ` H. Peter Anvin
2011-05-15 19:09   ` [PATCH] x86 pci acpi: rename struct pci_root_info Németh Márton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox