Signed-off-by: Andrew Morton --- lib/string.c | 23 ----------------------- mm/slab.c | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 23 deletions(-) diff -puN lib/string.c~create-a-kstrdup-library-function-ppc-fix lib/string.c --- 25/lib/string.c~create-a-kstrdup-library-function-ppc-fix 2005-05-09 20:09:30.000000000 -0700 +++ 25-akpm/lib/string.c 2005-05-09 20:09:30.000000000 -0700 @@ -23,7 +23,6 @@ #include #include #include -#include #ifndef __HAVE_ARCH_STRNICMP /** @@ -608,25 +607,3 @@ void *memchr(const void *s, int c, size_ } EXPORT_SYMBOL(memchr); #endif - -/* - * kstrdup - allocate space for and copy an existing string - * - * @s: the string to duplicate - * @gfp: the GFP mask used in the kmalloc() call when allocating memory - */ -char *kstrdup(const char *s, int gfp) -{ - size_t len; - char *buf; - - if (!s) - return NULL; - - len = strlen(s) + 1; - buf = kmalloc(len, gfp); - if (buf) - memcpy(buf, s, len); - return buf; -} -EXPORT_SYMBOL(kstrdup); diff -puN mm/slab.c~create-a-kstrdup-library-function-ppc-fix mm/slab.c --- 25/mm/slab.c~create-a-kstrdup-library-function-ppc-fix 2005-05-09 20:09:30.000000000 -0700 +++ 25-akpm/mm/slab.c 2005-05-09 20:09:30.000000000 -0700 @@ -92,6 +92,7 @@ #include #include #include +#include #include #include @@ -3078,3 +3079,26 @@ unsigned int ksize(const void *objp) return size; } + + +/* + * kstrdup - allocate space for and copy an existing string + * + * @s: the string to duplicate + * @gfp: the GFP mask used in the kmalloc() call when allocating memory + */ +char *kstrdup(const char *s, int gfp) +{ + size_t len; + char *buf; + + if (!s) + return NULL; + + len = strlen(s) + 1; + buf = kmalloc(len, gfp); + if (buf) + memcpy(buf, s, len); + return buf; +} +EXPORT_SYMBOL(kstrdup); _