Skip to contentSkip to conversation

lib: s390x: mmu: fix conflicting types for get_dat_entry

PATCH In review Nico Boehr 4 participants 4 messages May 8, 2023 – May 9, 2023

Subsystems (2)
lore
Share & tools
lore

Nico Boehr

author
#0 lore raw

PATCH 1/1 lib: s390x: mmu: fix conflicting types for get_dat_entry

This causes compilation to fail with GCC 13:

gcc -std=gnu99 -ffreestanding -I/kut/lib -I/kut/lib/s390x -Ilib -O2 -march=zEC12 -mbackchain -fno-delete-null-pointer-checks -g -MMD -MF lib/s390x/.mmu.d -fno-strict-aliasing -fno-common -Wall -Wwrite-strings -Wempty-body -Wuninitialized -Wignored-qualifiers -Wno-missing-braces -Werror -fomit-frame-pointer -fno-stack-protector -Wno-frame-address -fno-pic -no-pie -Wclobbered -Wunused-but-set-parameter -Wmissing-parameter-type -Wold-style-declaration -Woverride-init -Wmissing-prototypes -Wstrict-prototypes -I/kut/lib -I/kut/lib/s390x -Ilib -c -o lib/s390x/mmu.o lib/s390x/mmu.c
lib/s390x/mmu.c:132:7: error: conflicting types for ‘get_dat_entry’ due to enum/integer mismatch; have ‘void *(pgd_t *, void *, enum pgt_level)’ [-Werror=enum-int-mismatch]
132 | void *get_dat_entry(pgd_t *pgtable, void *vaddr, enum pgt_level level)

      |       ^~~~~~~~~~~~~
In file included from lib/s390x/mmu.c:16:
lib/s390x/mmu.h:96:7: note: previous declaration of ‘get_dat_entry’ with type ‘void *(pgd_t *, void *, unsigned int)’
   96 | void *get_dat_entry(pgd_t *pgtable, void *vaddr, unsigned int level);
      |       ^~~~~~~~~~~~~
---
 lib/s390x/mmu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/s390x/mmu.h +1 -1
index 15f88e4f424e..dadc2e600f9a 100644
@@ -93,6 +93,6 @@ static inline void unprotect_page(void *vaddr, unsigned long prot)
 	unprotect_dat_entry(vaddr, prot, pgtable_level_pte);
 }
 
-void *get_dat_entry(pgd_t *pgtable, void *vaddr, unsigned int level);
+void *get_dat_entry(pgd_t *pgtable, void *vaddr, enum pgt_level level);
 
 #endif /* _ASMS390X_MMU_H_ */
Signature · 1 line
2.39.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · Nico Boehr

This causes compilation to fail with GCC 13:

gcc -std=gnu99 -ffreestanding -I/kut/lib -I/kut/lib/s390x -Ilib -O2 -march=zEC12 -mbackchain -fno-delete-null-pointer-checks -g -MMD -MF lib/s390x/.mmu.d -fno-strict-aliasing -fno-common -Wall -Wwrite-strings -Wempty-body -Wuninitialized -Wignored-qualifiers -Wno-missing-braces -Werror -fomit-frame-pointer -fno-stack-protector -Wno-frame-address -fno-pic -no-pie -Wclobbered -Wunused-but-set-parameter -Wmissing-parameter-type -Wold-style-declaration -Woverride-init -Wmissing-prototypes -Wstrict-prototypes -I/kut/lib -I/kut/lib/s390x -Ilib -c -o lib/s390x/mmu.o lib/s390x/mmu.c
lib/s390x/mmu.c:132:7: error: conflicting types for ‘get_dat_entry’ due to enum/integer mismatch; have ‘void *(pgd_t *, void *, enum pgt_level)’ [-Werror=enum-int-mismatch]
132 | void *get_dat_entry(pgd_t *pgtable, void *vaddr, enum pgt_level level)

       |       ^~~~~~~~~~~~~
In file included from lib/s390x/mmu.c:16:
lib/s390x/mmu.h:96:7: note: previous declaration of ‘get_dat_entry’ with type ‘void *(pgd_t *, void *, unsigned int)’
    96 | void *get_dat_entry(pgd_t *pgtable, void *vaddr, unsigned int level);
       |       ^~~~~~~~~~~~~
---
  lib/s390x/mmu.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
lib/s390x/mmu.h +0 -0
index 15f88e4f424e..dadc2e600f9a 100644

lib/s390x/mmu.h static inline void unprotect_page(void *vaddr, unsigned long prot) · line 98

Quoted 7 lines
lib/s390x/mmu.h +1 -1
@@ -93,6 +93,6 @@ static inline void unprotect_page(void *vaddr, unsigned long prot)
  	unprotect_dat_entry(vaddr, prot, pgtable_level_pte);
  }
 
-void *get_dat_entry(pgd_t *pgtable, void *vaddr, unsigned int level);
+void *get_dat_entry(pgd_t *pgtable, void *vaddr, enum pgt_level level);
 
  #endif /* _ASMS390X_MMU_H_ */
Reviewed-by on v1 1/1
#2 lore raw
In reply to Nico Boehr
Quoted 5 lines · Nico Boehr

This causes compilation to fail with GCC 13:

gcc -std=gnu99 -ffreestanding -I/kut/lib -I/kut/lib/s390x -Ilib -O2 -march=zEC12 -mbackchain -fno-delete-null-pointer-checks -g -MMD -MF lib/s390x/.mmu.d -fno-strict-aliasing -fno-common -Wall -Wwrite-strings -Wempty-body -Wuninitialized -Wignored-qualifiers -Wno-missing-braces -Werror -fomit-frame-pointer -fno-stack-protector -Wno-frame-address -fno-pic -no-pie -Wclobbered -Wunused-but-set-parameter -Wmissing-parameter-type -Wold-style-declaration -Woverride-init -Wmissing-prototypes -Wstrict-prototypes -I/kut/lib -I/kut/lib/s390x -Ilib -c -o lib/s390x/mmu.o lib/s390x/mmu.c
lib/s390x/mmu.c:132:7: error: conflicting types for ‘get_dat_entry’ due to enum/integer mismatch; have ‘void *(pgd_t *, void *, enum pgt_level)’ [-Werror=enum-int-mismatch]
132 | void *get_dat_entry(pgd_t *pgtable, void *vaddr, enum pgt_level level)

Quoted 7 lines
      |       ^~~~~~~~~~~~~
In file included from lib/s390x/mmu.c:16:
lib/s390x/mmu.h:96:7: note: previous declaration of ‘get_dat_entry’ with type ‘void *(pgd_t *, void *, unsigned int)’
   96 | void *get_dat_entry(pgd_t *pgtable, void *vaddr, unsigned int level);
      |       ^~~~~~~~~~~~~
Quoted 16 lines
---
 lib/s390x/mmu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/s390x/mmu.h +1 -1
index 15f88e4f424e..dadc2e600f9a 100644
@@ -93,6 +93,6 @@ static inline void unprotect_page(void *vaddr, unsigned long prot)
 	unprotect_dat_entry(vaddr, prot, pgtable_level_pte);
 }
 
-void *get_dat_entry(pgd_t *pgtable, void *vaddr, unsigned int level);
+void *get_dat_entry(pgd_t *pgtable, void *vaddr, enum pgt_level level);
 
 #endif /* _ASMS390X_MMU_H_ */
Reviewed-by on v1 1/1
#3 lore raw
In reply to Nico Boehr
Quoted 5 lines · On Mon, 8 May 2023 12:24:26 +0200 Nico Boehr <[email protected]> wrote:

This causes compilation to fail with GCC 13:

gcc -std=gnu99 -ffreestanding -I/kut/lib -I/kut/lib/s390x -Ilib -O2 -march=zEC12 -mbackchain -fno-delete-null-pointer-checks -g -MMD -MF lib/s390x/.mmu.d -fno-strict-aliasing -fno-common -Wall -Wwrite-strings -Wempty-body -Wuninitialized -Wignored-qualifiers -Wno-missing-braces -Werror -fomit-frame-pointer -fno-stack-protector -Wno-frame-address -fno-pic -no-pie -Wclobbered -Wunused-but-set-parameter -Wmissing-parameter-type -Wold-style-declaration -Woverride-init -Wmissing-prototypes -Wstrict-prototypes -I/kut/lib -I/kut/lib/s390x -Ilib -c -o lib/s390x/mmu.o lib/s390x/mmu.c
lib/s390x/mmu.c:132:7: error: conflicting types for ‘get_dat_entry’ due to enum/integer mismatch; have ‘void *(pgd_t *, void *, enum pgt_level)’ [-Werror=enum-int-mismatch]
132 | void *get_dat_entry(pgd_t *pgtable, void *vaddr, enum pgt_level level)

Quoted 7 lines
      |       ^~~~~~~~~~~~~
In file included from lib/s390x/mmu.c:16:
lib/s390x/mmu.h:96:7: note: previous declaration of ‘get_dat_entry’ with type ‘void *(pgd_t *, void *, unsigned int)’
   96 | void *get_dat_entry(pgd_t *pgtable, void *vaddr, unsigned int level);
      |       ^~~~~~~~~~~~~
Quoted 16 lines
---
 lib/s390x/mmu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/s390x/mmu.h +1 -1
index 15f88e4f424e..dadc2e600f9a 100644
@@ -93,6 +93,6 @@ static inline void unprotect_page(void *vaddr, unsigned long prot)
 	unprotect_dat_entry(vaddr, prot, pgtable_level_pte);
 }
 
-void *get_dat_entry(pgd_t *pgtable, void *vaddr, unsigned int level);
+void *get_dat_entry(pgd_t *pgtable, void *vaddr, enum pgt_level level);
 
 #endif /* _ASMS390X_MMU_H_ */