arch/mips/boot/compressed/string.c: Fix build warnings
PATCH 1/1 arch/mips/boot/compressed/string.c: Fix build warnings
Fixes the following W=1 kernel build warning(s):arch/mips/boot/compressed/string.c:11:7: warning: no previous prototype for 'memcpy' [-Wmissing-prototypes]
void *memcpy(void *dest, const void *src, size_t n)
^~~~~~
arch/mips/boot/compressed/string.c:22:7: warning: no previous prototype for 'memset' [-Wmissing-prototypes]
void *memset(void *s, int c, size_t n)
^~~~~~
arch/mips/boot/compressed/string.c:32:15: warning: no previous prototype for 'memmove' [-Wmissing-prototypes]
void * __weak memmove(void *dest, const void *src, size_t n)
^~~~~~~--- arch/mips/boot/compressed/string.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/mips/boot/compressed/string.c +3 -3
@@ -8,7 +8,7 @@#include <linux/compiler_attributes.h> #include <linux/types.h> -void *memcpy (void *dest,const void *src,size_t n) +static void *memcpy (void *dest,const void *src,size_t n) {int i;const char *s = src;
@@ -19,7 +19,7 @@ void *memcpy(void *dest, const void *src, size_t n)return dest; } -void *memset (void *s,int c,size_t n) +static void *memset (void *s,int c,size_t n) {int i;char *ss = s;
@@ -29,7 +29,7 @@ void *memset(void *s, int c, size_t n)return s; } -void *__weak memmove (void *dest,const void *src,size_t n) +static void *__weak memmove (void *dest,const void *src,size_t n) {unsigned int i;const char *s = src;
Signature · 1 line
2.20.1
Quoted 9 lines · zhaoxiao
Fixes the following W=1 kernel build warning(s):
arch/mips/boot/compressed/string.c:11:7: warning: no previous prototype for 'memcpy' [-Wmissing-prototypes]
void *memcpy(void *dest, const void *src,size_tn)^~~~~~ arch/mips/boot/compressed/string.c:22:7: warning: no previous prototype for 'memset' [-Wmissing-prototypes] void *memset(void *s, int c, size_t n) ^~~~~~
arch/mips/boot/compressed/string.c:32:15: warning: no previous prototype for 'memmove' [-Wmissing-prototypes]
void *__weakmemmove(void *dest, const void *src, size_t n)
Hi Xiao,
Are you sure you know what you're doing?
They're supposed to be called by external reference in vmlinuz. Marking them static makes no sense.
Thanks.
- Jiaxun
Quoted 38 lines
^~~~~~~Signed-off-by zhaoxiao <[email protected]>--- arch/mips/boot/compressed/string.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/mips/boot/compressed/string.c +3
-3@@ -8,7 +8,7 @@#include <linux/compiler_attributes.h> #include <linux/types.h> -void *memcpy (void *dest,const void *src,size_t n) +static void *memcpy (void *dest,const void *src,size_t n) {int i;const char *s = src;@@ -19,7 +19,7 @@ void *memcpy(void *dest, const void *src, size_t n)return dest; } -void *memset (void *s,int c,size_t n) +static void *memset (void *s,int c,size_t n) {int i;char *ss = s;@@ -29,7 +29,7 @@ void *memset(void *s, int c, size_t n)return s; } -void *__weak memmove (void *dest,const void *src,size_t n) +static void *__weak memmove (void *dest,const void *src,size_t n) {unsigned int i;const char *s = src;
Hi,
Quoted 12 lines · Jiaxun Yang
Quoted 9 lines · zhaoxiao
Fixes the following W=1 kernel build warning(s):
arch/mips/boot/compressed/string.c:11:7: warning: no previous prototype for 'memcpy' [-Wmissing-prototypes]
void *memcpy(void *dest, const void *src,size_tn)^~~~~~ arch/mips/boot/compressed/string.c:22:7: warning: no previous prototype for 'memset' [-Wmissing-prototypes] void *memset(void *s, int c, size_t n) ^~~~~~
arch/mips/boot/compressed/string.c:32:15: warning: no previous prototype for 'memmove' [-Wmissing-prototypes]
void *__weakmemmove(void *dest, const void *src, size_t n)
Quoted 6 lines
Hi Xiao,
Are you sure you know what you're doing?
They're supposed to be called by external reference in vmlinuz. Marking them static makes no sense.
I was wondering that too.
I suppose including <asm/string.h> should be enough to fix the warnings.
Cheers,
-Paul
Quoted 36 lines
Quoted 35 lines
^~~~~~~Signed-off-by zhaoxiao <[email protected]>--- arch/mips/boot/compressed/string.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/mips/boot/compressed/string.c +3
-0@@ -8,7 +8,7 @@#include <linux/compiler_attributes.h> #include <linux/types.h> -void *memcpy(void *dest, const void *src, size_t n) +static void *memcpy(void *dest, const void *src, size_t n) {int i;const char *s = src;@@ -19,7 +19,7 @@ void *memcpy(void *dest, const void *src, size_t n)return dest; } -void *memset(void *s, int c, size_t n) +static void *memset(void *s, int c, size_t n) {int i;char *ss = s;@@ -29,7 +29,7 @@ void *memset(void *s, int c, size_t n)return s; } -void * __weak memmove(void *dest, const void *src, size_t n) +static void * __weak memmove(void *dest, const void *src, size_t n) {unsigned int i;const char *s = src;