All of lore.kernel.org
 help / color / mirror / Atom feed
* [-mm patch] inotify: fsnotify.h: use kstrdup
@ 2005-07-01 22:55 Adrian Bunk
  2005-07-01 23:20 ` Roland Dreier
  2005-07-01 23:36 ` Robert Love
  0 siblings, 2 replies; 5+ messages in thread
From: Adrian Bunk @ 2005-07-01 22:55 UTC (permalink / raw)
  To: Robert Love; +Cc: linux-kernel

kstrdup was added in 2.6.13-rc1.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.12-mm2-full/include/linux/fsnotify.h.old	2005-06-30 22:26:07.000000000 +0200
+++ linux-2.6.12-mm2-full/include/linux/fsnotify.h	2005-06-30 22:27:26.000000000 +0200
@@ -216,19 +216,10 @@
 
 /*
  * fsnotify_oldname_init - save off the old filename before we change it
- *
- * XXX: This could be kstrdup if only we could add that to lib/string.c
  */
 static inline const char *fsnotify_oldname_init(const char *name)
 {
-	size_t len;
-	char *buf;
-
-	len = strlen(name) + 1;
-	buf = kmalloc(len, GFP_KERNEL);
-	if (likely(buf))
-		memcpy(buf, name, len);
-	return buf;
+	return kstrdup(name, GFP_KERNEL);
 }
 
 /*


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-07-01 23:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-01 22:55 [-mm patch] inotify: fsnotify.h: use kstrdup Adrian Bunk
2005-07-01 23:20 ` Roland Dreier
2005-07-01 23:28   ` Adrian Bunk
2005-07-01 23:36   ` Robert Love
2005-07-01 23:36 ` Robert Love

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.