From: David S. Miller Date: Sun, 29 Jul 2007 09:10:37 +0000 (-0700) Subject: [SPARC]: Fix serial console node string creation. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f623f388e4f83c01ac23f228247a6a4b9cc71111;p=linux-beck.git [SPARC]: Fix serial console node string creation. The string setting code depends upon the original value of the "skip" variable, not the one that gets modified by the node traversal loop. Based upon a patch by Mark Fortescue. Signed-off-by: David S. Miller --- diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c index e3a537650db1..39fbd3c8ab0b 100644 --- a/arch/sparc/kernel/prom.c +++ b/arch/sparc/kernel/prom.c @@ -415,7 +415,7 @@ static void __init of_console_init(void) unsigned long flags; const char *type; phandle node; - int skip, fd; + int skip, tmp, fd; of_console_path = prom_early_alloc(256); @@ -442,8 +442,9 @@ static void __init of_console_init(void) prom_halt(); } + tmp = skip; for_each_node_by_type(dp, type) { - if (!skip--) + if (!tmp--) break; } if (!dp) {