* [PATCH] sparc: Clean arch-specific code in prom_common.c
@ 2009-01-04 1:47 Julian Calaby
2009-01-04 2:12 ` Julian Calaby
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Julian Calaby @ 2009-01-04 1:47 UTC (permalink / raw)
To: sparclinux
sparc: Clean arch-specific code in prom_common.c
prom_nextprop() and prom_firstprop() have slightly different calling
conventions in 32 and 64 bit SPARC.
prom_common.c uses a ifdef guard to ensure that these functions are
called correctly.
Adjust code to eliminate this ifdef by using a calling convention that
is compatible with both 32 and 64 bit SPARC.
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
---
This has been build tested on sparc64 native, however I'm yet to boot it.
It hasn't been checked with sparc32 as I lack a working build environment.
arch/sparc/kernel/prom_common.c | 14 +++-----------
1 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/arch/sparc/kernel/prom_common.c
b/arch/sparc/kernel/prom_common.c
index 4e9af59..ff7b591 100644
--- a/arch/sparc/kernel/prom_common.c
+++ b/arch/sparc/kernel/prom_common.c
@@ -155,20 +155,12 @@ static struct property * __init
build_one_prop(phandle node, char *prev,
p->value = prom_early_alloc(special_len);
memcpy(p->value, special_val, special_len);
} else {
-#ifdef CONFIG_SPARC32
- if (prev = NULL) {
- name = prom_firstprop(node, NULL);
- } else {
- name = prom_nextprop(node, prev, NULL);
- }
-#else
if (prev = NULL) {
- prom_firstprop(node, p->name);
+ name = prom_firstprop(node, p->name);
} else {
- prom_nextprop(node, prev, p->name);
+ name = prom_nextprop(node, prev, p->name);
}
- name = p->name;
-#endif
+
if (strlen(name) = 0) {
tmp = p;
return NULL;
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] sparc: Clean arch-specific code in prom_common.c
2009-01-04 1:47 [PATCH] sparc: Clean arch-specific code in prom_common.c Julian Calaby
@ 2009-01-04 2:12 ` Julian Calaby
2009-01-04 8:51 ` Sam Ravnborg
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Julian Calaby @ 2009-01-04 2:12 UTC (permalink / raw)
To: sparclinux
On Sun, Jan 4, 2009 at 12:47, Julian Calaby <julian.calaby@gmail.com> wrote:
> This has been build tested on sparc64 native, however I'm yet to boot it.
I've now booted an image based upon this and it works perfectly so far.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] sparc: Clean arch-specific code in prom_common.c
2009-01-04 1:47 [PATCH] sparc: Clean arch-specific code in prom_common.c Julian Calaby
2009-01-04 2:12 ` Julian Calaby
@ 2009-01-04 8:51 ` Sam Ravnborg
2009-01-04 10:10 ` Julian Calaby
2009-01-05 8:07 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2009-01-04 8:51 UTC (permalink / raw)
To: sparclinux
On Sun, Jan 04, 2009 at 12:47:52PM +1100, Julian Calaby wrote:
> sparc: Clean arch-specific code in prom_common.c
>
> prom_nextprop() and prom_firstprop() have slightly different calling
> conventions in 32 and 64 bit SPARC.
>
> prom_common.c uses a ifdef guard to ensure that these functions are
> called correctly.
>
> Adjust code to eliminate this ifdef by using a calling convention that
> is compatible with both 32 and 64 bit SPARC.
>
> Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Looks good.
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
As a natural next step you could eliminate the following:
#ifdef CONFIG_SPARC32
strcpy(p->name, name);
#endif
by moving this strcpy() to the prom_* functions
for sparc32.
Sam
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] sparc: Clean arch-specific code in prom_common.c
2009-01-04 1:47 [PATCH] sparc: Clean arch-specific code in prom_common.c Julian Calaby
2009-01-04 2:12 ` Julian Calaby
2009-01-04 8:51 ` Sam Ravnborg
@ 2009-01-04 10:10 ` Julian Calaby
2009-01-05 8:07 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Julian Calaby @ 2009-01-04 10:10 UTC (permalink / raw)
To: sparclinux
On Sun, Jan 4, 2009 at 19:51, Sam Ravnborg <sam@ravnborg.org> wrote:
> Looks good.
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Thanks!
> As a natural next step you could eliminate the following:
> #ifdef CONFIG_SPARC32
> strcpy(p->name, name);
> #endif
>
> by moving this strcpy() to the prom_* functions
> for sparc32.
It's happening soon, but there's other changes that have to happen at
the same time to have it not be useless code, so that's happening with
some of the cleanups of the prom/tree_*.c files prior to their
unification.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sparc: Clean arch-specific code in prom_common.c
2009-01-04 1:47 [PATCH] sparc: Clean arch-specific code in prom_common.c Julian Calaby
` (2 preceding siblings ...)
2009-01-04 10:10 ` Julian Calaby
@ 2009-01-05 8:07 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2009-01-05 8:07 UTC (permalink / raw)
To: sparclinux
From: Sam Ravnborg <sam@ravnborg.org>
Date: Sun, 4 Jan 2009 09:51:12 +0100
> On Sun, Jan 04, 2009 at 12:47:52PM +1100, Julian Calaby wrote:
> > sparc: Clean arch-specific code in prom_common.c
> >
> > prom_nextprop() and prom_firstprop() have slightly different calling
> > conventions in 32 and 64 bit SPARC.
> >
> > prom_common.c uses a ifdef guard to ensure that these functions are
> > called correctly.
> >
> > Adjust code to eliminate this ifdef by using a calling convention that
> > is compatible with both 32 and 64 bit SPARC.
> >
> > Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
>
> Looks good.
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Looks good to me too, applied.
Thanks everyone.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-01-05 8:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-04 1:47 [PATCH] sparc: Clean arch-specific code in prom_common.c Julian Calaby
2009-01-04 2:12 ` Julian Calaby
2009-01-04 8:51 ` Sam Ravnborg
2009-01-04 10:10 ` Julian Calaby
2009-01-05 8:07 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.