* [PATCH] Replace use of GET_64BIT(prop, i) with of_read_number().
@ 2007-06-04 20:24 Jon Loeliger
2007-06-05 1:26 ` David Gibson
0 siblings, 1 reply; 2+ messages in thread
From: Jon Loeliger @ 2007-06-04 20:24 UTC (permalink / raw)
To: linuxppc-dev@ozlabs.org
Remove uses of hack GET_64BIT() property macro and use
the more general of_read_number() function from prom.h
as suggested by Milton.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
---
Someone in 64-bit land please check this!
I have no board on which to test this. Sorry.
jdl
arch/powerpc/kernel/pci_64.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 249cca2..b7cd53f 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -291,7 +291,6 @@ static unsigned int pci_parse_of_flags(u32 addr0)
return flags;
}
-#define GET_64BIT(prop, i) ((((u64) (prop)[(i)]) << 32) | (prop)[(i)+1])
static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev)
{
@@ -310,8 +309,8 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev)
flags = pci_parse_of_flags(addrs[0]);
if (!flags)
continue;
- base = GET_64BIT(addrs, 1);
- size = GET_64BIT(addrs, 3);
+ base = of_read_number(&addrs[1], 2);
+ size = of_read_number(&addrs[3], 2);
if (!size)
continue;
i = addrs[0] & 0xff;
@@ -477,7 +476,7 @@ void __devinit of_scan_pci_bridge(struct device_node *node,
i = 1;
for (; len >= 32; len -= 32, ranges += 8) {
flags = pci_parse_of_flags(ranges[0]);
- size = GET_64BIT(ranges, 6);
+ size = of_read_number(&ranges[6], 2);
if (flags == 0 || size == 0)
continue;
if (flags & IORESOURCE_IO) {
@@ -496,7 +495,7 @@ void __devinit of_scan_pci_bridge(struct device_node *node,
res = bus->resource[i];
++i;
}
- res->start = GET_64BIT(ranges, 1);
+ res->start = of_read_number(&ranges[1], 2);
res->end = res->start + size - 1;
res->flags = flags;
fixup_resource(res, dev);
--
1.5.0.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Replace use of GET_64BIT(prop, i) with of_read_number().
2007-06-04 20:24 [PATCH] Replace use of GET_64BIT(prop, i) with of_read_number() Jon Loeliger
@ 2007-06-05 1:26 ` David Gibson
0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2007-06-05 1:26 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev@ozlabs.org
On Mon, Jun 04, 2007 at 03:24:18PM -0500, Jon Loeliger wrote:
> Remove uses of hack GET_64BIT() property macro and use
> the more general of_read_number() function from prom.h
> as suggested by Milton.
>
> Signed-off-by: Jon Loeliger <jdl@freescale.com>
> ---
>
> Someone in 64-bit land please check this!
> I have no board on which to test this. Sorry.
Gave it a brief whirl on a POWER5 LPAR. Seems ok.
Acked-by: David Gibson <david@gibson.dropbear.id.au>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-06-05 1:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-04 20:24 [PATCH] Replace use of GET_64BIT(prop, i) with of_read_number() Jon Loeliger
2007-06-05 1:26 ` David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).