[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20090720173834.GA14288@cs.unibo.it>
Date: Mon, 20 Jul 2009 19:38:35 +0200
From: Renzo Davoli <renzo@...unibo.it>
To: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] fs/char_dev.c: remove useless loop
There are two useless lines in fs/char_dev.c.
In register_chrdev there is a loop to change all '/' into '!' in the
kernel object name.
This code is useless as the same substitution is in kobject_set_name_vargs in
lib/kobject.c:
228 /* ewww... some of these buggers have '/' in the name ... */
229 while ((s = strchr(kobj->name, '/')))
230 s[0] = '!';
kobject_set_name_vargs is called by kobject_set_name.
kobject_set_name is called just above the useless loop.
renzo
Signed-off-by: Renzo Davoli <renzo@...unibo.it>
--
--- a/fs/char_dev.c 2009-07-20 19:06:51.000000000 +0200
+++ b/fs/char_dev.c 2009-07-20 19:14:26.000000000 +0200
@@ -278,8 +278,6 @@
cdev->owner = fops->owner;
cdev->ops = fops;
kobject_set_name(&cdev->kobj, "%s", name);
- for (s = strchr(kobject_name(&cdev->kobj),'/'); s; s = strchr(s, '/'))
- *s = '!';
err = cdev_add(cdev, MKDEV(cd->major, 0), 256);
if (err)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists