lib: string: compile strlcat() and memscpy()

Make strlcat() and memscpy() function
as compilable by removing unnecessary
things.

Change-Id: I77759fbf7e150a169d9a756542c806493e85e183
Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
diff --git a/include/linux/string.h b/include/linux/string.h
index 8d168e0..f728445 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -83,6 +83,9 @@
 #ifndef __HAVE_ARCH_MEMCPY
 extern void * memcpy(void *,const void *,__kernel_size_t);
 #endif
+#ifndef __HAVE_ARCH_MEMSCPY
+extern size_t memscpy(void *dest, size_t dst_size, const void *src, size_t copy_size);
+#endif
 #ifndef __HAVE_ARCH_MEMMOVE
 extern void * memmove(void *,const void *,__kernel_size_t);
 #endif
diff --git a/lib/string.c b/lib/string.c
index 0dec46c..233adee 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -200,7 +200,6 @@
 	dest[len] = 0;
 	return res;
 }
-EXPORT_SYMBOL(strlcat);
 #endif
 
 #ifndef __HAVE_ARCH_STRCMP
@@ -548,11 +547,30 @@
 }
 #endif
 
-size_t memscpy(void *dest, size_t dst_size, const void *src, size_t copy_size) {
+#ifndef __HAVE_ARCH_MEMSCPY
+/**
+ * memscpy - Copy one area of memory to another
+ * @dest: Where to copy to
+ * @src: Where to copy from
+ * @dst_size: The size of destination buffer area
+ * @copy_size: The size of source buffer area
+ *
+ * You should not use this function where memcpy
+ * was used to copy null terminated buffer, the
+ * replacement function is strlcpy() and strlcat()
+ * depending on situation.
+ *
+ * The aim of memscpy() is to prevent buffer overflow
+ * by taking both destination buffer size and source
+ * buffer size.
+ */
+size_t memscpy(void *dest, size_t dst_size, const void *src, size_t copy_size) 
+{
 	size_t min_size = dst_size < copy_size ? dst_size : copy_size;
 	memcpy(dest, src, min_size);
 	return min_size;
 }
+#endif
 
 #ifndef __HAVE_ARCH_MEMMOVE
 /**