mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs/char_dev.c: remove useless loop
@ 2009-07-20 17:38 Renzo Davoli
  0 siblings, 0 replies; only message in thread
From: Renzo Davoli @ 2009-07-20 17:38 UTC (permalink / raw)
  To: LKML

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@cs.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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-20 18:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-20 17:38 [PATCH] fs/char_dev.c: remove useless loop Renzo Davoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®