* [PATCH] arch/mips/boot/compressed/string.c: Fix build warnings
@ 2021-05-19 8:44 zhaoxiao
2021-05-19 14:00 ` Jiaxun Yang
0 siblings, 1 reply; 3+ messages in thread
From: zhaoxiao @ 2021-05-19 8:44 UTC (permalink / raw)
To: tsbogend; +Cc: paul, linux-mips, linux-kernel, 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_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)
^~~~~~~
Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
---
arch/mips/boot/compressed/string.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/mips/boot/compressed/string.c b/arch/mips/boot/compressed/string.c
index 0b593b709228..d28996509f91 100644
--- a/arch/mips/boot/compressed/string.c
+++ b/arch/mips/boot/compressed/string.c
@@ -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;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arch/mips/boot/compressed/string.c: Fix build warnings
2021-05-19 8:44 [PATCH] arch/mips/boot/compressed/string.c: Fix build warnings zhaoxiao
@ 2021-05-19 14:00 ` Jiaxun Yang
2021-05-19 14:14 ` Paul Cercueil
0 siblings, 1 reply; 3+ messages in thread
From: Jiaxun Yang @ 2021-05-19 14:00 UTC (permalink / raw)
To: zhaoxiao, tsbogend; +Cc: paul, linux-mips, linux-kernel
在 2021/5/19 16:44, 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_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)
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
> ^~~~~~~
>
> Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
> ---
> arch/mips/boot/compressed/string.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/mips/boot/compressed/string.c b/arch/mips/boot/compressed/string.c
> index 0b593b709228..d28996509f91 100644
> --- a/arch/mips/boot/compressed/string.c
> +++ b/arch/mips/boot/compressed/string.c
> @@ -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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arch/mips/boot/compressed/string.c: Fix build warnings
2021-05-19 14:00 ` Jiaxun Yang
@ 2021-05-19 14:14 ` Paul Cercueil
0 siblings, 0 replies; 3+ messages in thread
From: Paul Cercueil @ 2021-05-19 14:14 UTC (permalink / raw)
To: Jiaxun Yang; +Cc: zhaoxiao, tsbogend, linux-mips, linux-kernel
Hi,
Le mer., mai 19 2021 at 22:00:07 +0800, Jiaxun Yang
<jiaxun.yang@flygoat.com> a écrit :
>
>
> 在 2021/5/19 16:44, 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_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)
> 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
>> ^~~~~~~
>>
>> Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
>> ---
>> arch/mips/boot/compressed/string.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/mips/boot/compressed/string.c
>> b/arch/mips/boot/compressed/string.c
>> index 0b593b709228..d28996509f91 100644
>> --- a/arch/mips/boot/compressed/string.c
>> +++ b/arch/mips/boot/compressed/string.c
>> @@ -8,7 +8,7 @@
>> #include <linux/compiler_attributes.h>
>> #include <linux/types.h>
>> \x7f-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;
>> }
>> \x7f-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;
>> }
>> \x7f-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;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-19 14:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 8:44 [PATCH] arch/mips/boot/compressed/string.c: Fix build warnings zhaoxiao
2021-05-19 14:00 ` Jiaxun Yang
2021-05-19 14:14 ` Paul Cercueil
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.