diff mbox series

[linux-next] include/getcpu.h: Fixed kernel test robot warning

Message ID 1606578117-2895-1-git-send-email-jrdr.linux@gmail.com (mailing list archive)
State New, archived
Headers show
Series [linux-next] include/getcpu.h: Fixed kernel test robot warning | expand

Commit Message

Souptick Joarder Nov. 28, 2020, 3:41 p.m. UTC
Kernel test robot generates below warning ->

>> arch/s390/kernel/vdso64/getcpu.c:8:5: warning: no previous prototype
>> for function '__s390_vdso_getcpu' [-Wmissing-prototypes]
   int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct
getcpu_cache *unused)
       ^
   arch/s390/kernel/vdso64/getcpu.c:8:1: note: declare 'static' if the
function is not intended to be used outside of this translation unit
   int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct
getcpu_cache *unused)
   ^
   static
   1 warning generated.

vim +/__s390_vdso_getcpu +8 arch/s390/kernel/vdso64/getcpu.c

     7
   > 8  int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct
   > getcpu_cache *unused)

It is fixed by adding a prototype.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
---
 include/linux/getcpu.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Heiko Carstens Nov. 30, 2020, 1:18 p.m. UTC | #1
On Sat, Nov 28, 2020 at 09:11:57PM +0530, Souptick Joarder wrote:
> Kernel test robot generates below warning ->
> 
> >> arch/s390/kernel/vdso64/getcpu.c:8:5: warning: no previous prototype
> >> for function '__s390_vdso_getcpu' [-Wmissing-prototypes]
>    int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct
> getcpu_cache *unused)
>        ^
>    arch/s390/kernel/vdso64/getcpu.c:8:1: note: declare 'static' if the
> function is not intended to be used outside of this translation unit
>    int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct
> getcpu_cache *unused)
>    ^
>    static
>    1 warning generated.
> 
> vim +/__s390_vdso_getcpu +8 arch/s390/kernel/vdso64/getcpu.c
> 
>      7
>    > 8  int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct
>    > getcpu_cache *unused)
> 
> It is fixed by adding a prototype.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> ---
>  include/linux/getcpu.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/getcpu.h b/include/linux/getcpu.h
> index c304dcd..43c9208 100644
> --- a/include/linux/getcpu.h
> +++ b/include/linux/getcpu.h
> @@ -16,4 +16,5 @@ struct getcpu_cache {
>  	unsigned long blob[128 / sizeof(long)];
>  };
>  
> +int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused);

Sorry, no. We won't add s390 specific prototypes to common code header
files. Anyway, I solved this differently and the "fix" should be in
linux-next soon.
diff mbox series

Patch

diff --git a/include/linux/getcpu.h b/include/linux/getcpu.h
index c304dcd..43c9208 100644
--- a/include/linux/getcpu.h
+++ b/include/linux/getcpu.h
@@ -16,4 +16,5 @@  struct getcpu_cache {
 	unsigned long blob[128 / sizeof(long)];
 };
 
+int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused);
 #endif