From patchwork Tue Apr 20 12:18:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 50536 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id ADE26B7F99 for ; Tue, 20 Apr 2010 22:18:24 +1000 (EST) Received: by ozlabs.org (Postfix) id D6D26B7D13; Tue, 20 Apr 2010 22:18:18 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from [127.0.0.1] (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 9C7BAB7D0C; Tue, 20 Apr 2010 22:18:18 +1000 (EST) Subject: Re: [Bug #15589] 2.6.34-rc1: Badness at fs/proc/generic.c:316 From: Michael Ellerman To: Christian Kujau In-Reply-To: References: Date: Tue, 20 Apr 2010 22:18:18 +1000 Message-ID: <1271765898.4324.2.camel@concordia> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Cc: Linux Kernel Mailing List , "Rafael J. Wysocki" , linuxppc-dev@ozlabs.org, schwab@linux-m68k.org, Kernel Testers List , adobriyan@gmail.com, Maciej Rutecki X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: michael@ellerman.id.au List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org On Mon, 2010-04-19 at 23:45 -0700, Christian Kujau wrote: > On Tue, 20 Apr 2010 at 05:19, Rafael J. Wysocki wrote: > > Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=15589 > > Subject : 2.6.34-rc1: Badness at fs/proc/generic.c:316 > > Submitter : Christian Kujau > > Date : 2010-03-13 23:53 (38 days old) > > Message-ID : > > References : http://marc.info/?l=linux-kernel&m=126852442903680&w=2 > > Yes, unless something in this area has changed from -rc4 to -rc5, this is > still printed during boot: > > > device-tree: Duplicate name in /cpus/PowerPC,G4@0, renamed to "l2-cache#1" > name 'pulses/rev' > ------------[ cut here ]------------ Don't cut here, sigh. > Badness at fs/proc/generic.c:317 Try this 100% unbuilt, 100% untested patch. cheers diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c index f8650dc..9502b48 100644 --- a/fs/proc/proc_devtree.c +++ b/fs/proc/proc_devtree.c @@ -175,6 +175,24 @@ retry: return fixed_name; } +static const char *unslash_name(const char *name) +{ + char *p, *fixed_name; + + fixed_name = kstrdup(name); + if (!fixed_name) { + printk(KERN_ERR "device-tree: Out of memory trying to unslash " + "name \"%s\"\n", name); + return name; + } + + p = fixed_name; + while ((p = strstr(p, "/"))) + *p++ = '_'; + + return fixed_name; +} + /* * Process a node, adding entries for its children and its properties. */ @@ -211,6 +229,9 @@ void proc_device_tree_add_node(struct device_node *np, if (duplicate_name(de, p)) p = fixup_name(np, de, p); + if (strstr(p, "/")) + p = unslash_name(p); + ent = __proc_device_tree_add_prop(de, pp, p); if (ent == NULL) break;