diff options
author | Tiwei Bie <tiwei.btw@antgroup.com> | 2024-03-06 18:19:25 +0800 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2024-04-22 21:58:48 +0200 |
commit | 49ff7d871242d7fd8adb8a2d8347c5d94dda808b (patch) | |
tree | 34fdfaeeeea732da8208d45f4c6e868e3452c10d /arch | |
parent | 19cf79157309ea3834caf9ef442722f776b93814 (diff) | |
download | linux-stable-49ff7d871242d7fd8adb8a2d8347c5d94dda808b.tar.gz linux-stable-49ff7d871242d7fd8adb8a2d8347c5d94dda808b.tar.bz2 linux-stable-49ff7d871242d7fd8adb8a2d8347c5d94dda808b.zip |
um: Fix -Wmissing-prototypes warnings for __warp_* and foo
These functions are not called explicitly. Let's just workaround
the -Wmissing-prototypes warnings by declaring them locally similar
to what was done in arch/x86/kernel/asm-offsets_32.c.
This will address below -Wmissing-prototypes warnings:
./arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes]
arch/um/os-Linux/main.c:187:7: warning: no previous prototype for ‘__wrap_malloc’ [-Wmissing-prototypes]
arch/um/os-Linux/main.c:208:7: warning: no previous prototype for ‘__wrap_calloc’ [-Wmissing-prototypes]
arch/um/os-Linux/main.c:222:6: warning: no previous prototype for ‘__wrap_free’ [-Wmissing-prototypes]
arch/x86/um/user-offsets.c:17:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes]
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/os-Linux/main.c | 5 | ||||
-rw-r--r-- | arch/x86/um/shared/sysdep/kernel-offsets.h | 3 | ||||
-rw-r--r-- | arch/x86/um/user-offsets.c | 3 |
3 files changed, 11 insertions, 0 deletions
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index c8a42ecbd7a2..e82164f90288 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -184,6 +184,11 @@ int __init main(int argc, char **argv, char **envp) extern void *__real_malloc(int); +/* workaround for -Wmissing-prototypes warnings */ +void *__wrap_malloc(int size); +void *__wrap_calloc(int n, int size); +void __wrap_free(void *ptr); + void *__wrap_malloc(int size) { void *ret; diff --git a/arch/x86/um/shared/sysdep/kernel-offsets.h b/arch/x86/um/shared/sysdep/kernel-offsets.h index a004bffb7b8d..48de3a71f845 100644 --- a/arch/x86/um/shared/sysdep/kernel-offsets.h +++ b/arch/x86/um/shared/sysdep/kernel-offsets.h @@ -6,6 +6,9 @@ #include <linux/kbuild.h> #include <asm/mman.h> +/* workaround for a warning with -Wmissing-prototypes */ +void foo(void); + void foo(void) { #include <common-offsets.h> diff --git a/arch/x86/um/user-offsets.c b/arch/x86/um/user-offsets.c index e54a9814ccf1..1c77d9946199 100644 --- a/arch/x86/um/user-offsets.c +++ b/arch/x86/um/user-offsets.c @@ -14,6 +14,9 @@ COMMENT(#val " / sizeof(unsigned long)"); \ DEFINE(sym, val / sizeof(unsigned long)) +/* workaround for a warning with -Wmissing-prototypes */ +void foo(void); + void foo(void) { #ifdef __i386__ |