UML: Fix compiler warning due to missing task_struct declaration

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, May 20, 2010 - 11:00 am

Gitweb:     http://git.kernel.org/linus/4cb3ca7cd7e2cae8d1daf5345ec99a1e8502cf3f
Commit:     4cb3ca7cd7e2cae8d1daf5345ec99a1e8502cf3f
Parent:     0df6e9402e9f6f77b2d431f35ba0f8906b9ca8f3
Author:     Jan Kiszka <jan.kiszka@web.de>
AuthorDate: Mon Apr 19 23:53:06 2010 +0200
Committer:  Jiri Kosina <jkosina@suse.cz>
CommitDate: Wed Apr 21 01:43:03 2010 +0200

    UML: Fix compiler warning due to missing task_struct declaration
    
    We can't pull in linux/sched.h due to circular dependency, so just
    forward-declare the struct.
    
    This fixes the following warning:
    
      CC      arch/um/sys-i386/elfcore.o
    In file included from /data/linux-2.6/include/linux/elf.h:8,
                     from /data/linux-2.6/arch/um/sys-i386/elfcore.c:2:
    arch/um/sys-i386/asm/elf.h:78: warning: ‘struct task_struct’ declared inside parameter list
    arch/um/sys-i386/asm/elf.h:78: warning: its scope is only this definition or declaration, which is probably not what you want
    
    I guess not many people build against i386 hosts anymore, so this
    remained widely unnoticed.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 arch/um/sys-i386/asm/elf.h   |    2 ++
 arch/um/sys-x86_64/asm/elf.h |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/um/sys-i386/asm/elf.h b/arch/um/sys-i386/asm/elf.h
index e64cd41..a979a22 100644
--- a/arch/um/sys-i386/asm/elf.h
+++ b/arch/um/sys-i386/asm/elf.h
@@ -75,6 +75,8 @@ typedef struct user_i387_struct elf_fpregset_t;
 	pr_reg[16] = PT_REGS_SS(regs);		\
 } while (0);
 
+struct task_struct;
+
 extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu);
 
 #define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu)
diff --git a/arch/um/sys-x86_64/asm/elf.h b/arch/um/sys-x86_64/asm/elf.h
index 49655c8..d760967 100644
--- a/arch/um/sys-x86_64/asm/elf.h
+++ b/arch/um/sys-x86_64/asm/elf.h
@@ -95,6 +95,8 @@ typedef struct user_i387_struct elf_fpregset_t;
 	(pr_reg)[25] = 0;					\
 	(pr_reg)[26] = 0;
 
+struct task_struct;
+
 extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu);
 
 #define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu)
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
UML: Fix compiler warning due to missing task_struct decla ..., Linux Kernel Mailing ..., (Thu May 20, 11:00 am)