<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 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-03 16:14:21.000000000 -0700
+++ 25-akpm/lib/string.c	2005-05-03 16:14:21.000000000 -0700
@@ -23,7 +23,6 @@
 #include &lt;linux/string.h&gt;
 #include &lt;linux/ctype.h&gt;
 #include &lt;linux/module.h&gt;
-#include &lt;linux/slab.h&gt;
 
 #ifndef __HAVE_ARCH_STRNICMP
 /**
@@ -604,25 +603,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-03 16:14:21.000000000 -0700
+++ 25-akpm/mm/slab.c	2005-05-03 16:14:21.000000000 -0700
@@ -92,6 +92,7 @@
 #include	&lt;linux/sysctl.h&gt;
 #include	&lt;linux/module.h&gt;
 #include	&lt;linux/rcupdate.h&gt;
+#include	&lt;linux/string.h&gt;
 
 #include	&lt;asm/uaccess.h&gt;
 #include	&lt;asm/cacheflush.h&gt;
@@ -3075,3 +3076,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);
_
</pre></body></html>