Skip to contentSkip to conversation

MIPS: Fix elfcore.c build warning

PATCH In review Yang Shi 2 participants 2 messages Mar 11, 2010

Subsystems (2)
lore
Share & tools
lore

Yang Shi

author
#0 lore raw

PATCH 1/1 MIPS: Fix elfcore.c build warning

kernel/elfcore.c includes elf.h which includes arch specific elf.h. In MIPS elf.h, 'struct pt_regs' is declared inside the parameter list of elf_dump_regs function. This cause kernel build warning.

So, move the declaration out of the function parameter list to remove build warning.

---
 arch/mips/include/asm/elf.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/mips/include/asm/elf.h +2 -1
index e53d7be..370bf50 100644
@@ -311,8 +311,9 @@ do {									\
 #endif /* CONFIG_64BIT */
 
 struct task_struct;
+struct pt_regs;
 
-extern void elf_dump_regs(elf_greg_t *, struct pt_regs *regs);
+extern void elf_dump_regs(elf_greg_t *, struct pt_regs *);
 extern int dump_task_regs(struct task_struct *, elf_gregset_t *);
 extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
 
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 6 lines · Yang Shi

kernel/elfcore.c includes elf.h which includes arch specific elf.h. In MIPS elf.h, 'struct pt_regs' is declared inside the parameter list of elf_dump_regs function. This cause kernel build warning.

So, move the declaration out of the function parameter list to remove build warning.

What fixes the warning is the forward declaration of struct pt_regs not removing the function parameter name. So I've added a patch which does just that.

Thanks!

Ralf