Skip to contentSkip to conversation

um: headers: fix various W=1 warnings

PATCH New Randy Dunlap 1 participant 4 messages Apr 14, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover um: headers: fix various W=1 warnings

Fix a few W=1 warnings in arch/um/. Prompted by the "kernel test robot".

Cc Jeff Dike <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Anton Ivanov <[email protected]>

[PATCH 1/3] um: pgtable.h: fix W=1 warning for empty body in 'do' statement [PATCH 2/3] um: elf.h: fix W=1 warning for empty body in 'do' statement [PATCH 3/3] um: stub_32.h: move 'inline' before 'void' to fix W=1 warning

 arch/um/include/asm/pgtable.h       |    2 +-
 arch/x86/um/asm/elf.h               |    2 +-
 arch/x86/um/shared/sysdep/stub_32.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

_______________________________________________
linux-um mailing list [email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

#1 lore raw

PATCH 1/3 um: pgtable.h: fix W=1 warning for empty body in 'do' statement

Use the common kernel style to eliminate a warning:

./arch/um/include/asm/pgtable.h:305:47: warning: suggest braces around empty body in ‘do’ statement [-Wempty-body]

 #define update_mmu_cache(vma,address,ptep) do ; while (0)
                                               ^

mm/filemap.c:3212:3: note: in expansion of macro ‘update_mmu_cache’
update_mmu_cache(vma, addr, vmf->pte); ^~~~~~~~~~~~~~~~

Cc Jeff Dike <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Anton Ivanov <[email protected]>
---
 arch/um/include/asm/pgtable.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/include/asm/pgtable.h +1 -1
@@ -302,7 +302,7 @@ static inline pte_t pte_modify(pte_t pte
 struct mm_struct;
 extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
 
-#define update_mmu_cache(vma,address,ptep) do ; while (0)
+#define update_mmu_cache(vma,address,ptep) do {} while (0)
 
 /* Encode and de-code a swap entry */
 #define __swp_type(x)			(((x).val >> 5) & 0x1f)

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

#2 lore raw

PATCH 2/3 um: elf.h: fix W=1 warning for empty body in 'do' statement

In reply to Randy Dunlap

Use the common kernel style to eliminate a warning:

./arch/x86/um/asm/elf.h:215:32: warning: suggest braces around empty body in ‘do’ statement [-Wempty-body]

 #define SET_PERSONALITY(ex) do ; while(0)
                                ^
Cc Jeff Dike <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Anton Ivanov <[email protected]>
---
 arch/x86/um/asm/elf.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/um/asm/elf.h +1 -1
@@ -212,6 +212,6 @@ extern int elf_core_copy_fpregs(struct t
 extern long elf_aux_hwcap;
 #define ELF_HWCAP (elf_aux_hwcap)
 
-#define SET_PERSONALITY(ex) do ; while(0)
+#define SET_PERSONALITY(ex) do {} while(0)
 
 #endif

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

#3 lore raw

PATCH 3/3 um: stub_32.h: move 'inline' before 'void' to fix W=1 warning

In reply to Randy Dunlap

Use the expected ordering of function modifier keywords.

arch/x86/um/shared/sysdep/stub_32.h:80:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration]
static void inline remap_stack_and_trap(void)
^~~~~~

---
 arch/x86/um/shared/sysdep/stub_32.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/um/shared/sysdep/stub_32.h +1 -1
@@ -77,7 +77,7 @@ static inline void trap_myself(void)
 	__asm("int3");
 }
 
-static void inline remap_stack_and_trap(void)
+static inline void remap_stack_and_trap(void)
 {
 	__asm__ volatile (
 		"movl %%esp,%%ebx ;"

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um