Skip to contentSkip to conversation

include/getcpu.h: Fixed kernel test robot warning

PATCH In review Souptick Joarder 2 participants 2 messages Nov 28, 2020 – Nov 30, 2020 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include/getcpu.h: Fixed kernel test robot warning

Kernel test robot generates below warning ->

Quoted 2 lines
Quoted 2 lines

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
Quoted 2 lines

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

It is fixed by adding a prototype.

---
 include/linux/getcpu.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/getcpu.h +1 -0
index c304dcd..43c9208 100644
@@ -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
Signature · 1 line
1.9.1
#1 lore raw
Quoted 34 lines · Souptick Joarder

Kernel test robot generates below warning ->

Quoted 2 lines
Quoted 2 lines

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
Quoted 2 lines

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

It is fixed by adding a prototype.

---
 include/linux/getcpu.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/getcpu.h +0 -0
index c304dcd..43c9208 100644

include/linux/getcpu.h struct getcpu_cache { · line 19

Quoted 4 lines
include/linux/getcpu.h +1 -0
@@ -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.