[-mm patch] inotify: fsnotify.h: use kstrdup

From: Adrian Bunk
Date: Fri Jul 01 2005 - 17:59:14 EST


kstrdup was added in 2.6.13-rc1.

Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>

--- 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);
}

/*

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/