Re: [Patch] arch/um/include/init.h: Fix missing macro definitions
On Thu, Jan 31, 2008 at 11:06:34PM +0800, WANG Cong wrote: > This patch fixed the following build error in current -git tree. > > arch/um/kernel/config.c:10: error: expected declaration specifiers or '...' > before '.' token > ... This is close to uml-arch-um-include-inith-needs-a-definition-of-__used.patch that's currently in -mm. Andrew, could you replace uml-arch-um-include-inith-needs-a-definition-of-__used.patch with the version below and push it to Linus? Jeff -- Work email - jdike at linux dot intel dot com init.h started breaking now for some reason. It turns out that there wasn't a definition of __used. Fixed this by copying the relevant stuff from compiler.h in the userspace case, and including compiler.h in the kernel case. >From WANG Cong <[EMAIL PROTECTED]> - added definition of __section Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Cc: WANG Cong <[EMAIL PROTECTED]> --- arch/um/include/init.h | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) Index: linux-2.6-git/arch/um/include/init.h === --- linux-2.6-git.orig/arch/um/include/init.h 2008-02-01 10:41:14.0 -0500 +++ linux-2.6-git/arch/um/include/init.h2008-02-01 10:52:34.0 -0500 @@ -40,6 +40,20 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); +#ifndef __KERNEL__ +#ifndef __section +# define __section(S) __attribute__ ((__section__(#S))) +#endif + +#if __GNUC_MINOR__ >= 3 +# define __used__attribute__((__used__)) +#else +# define __used__attribute__((__unused__)) +#endif + +#else +#include +#endif /* These are for everybody (although not all archs will actually discard it in modules) */ #define __init __section(.init.text) @@ -127,14 +141,3 @@ extern struct uml_param __uml_setup_star #endif #endif /* _LINUX_UML_INIT_H */ - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --- - * Local variables: - * c-file-style: "linux" - * End: - */ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Patch] arch/um/include/init.h: Fix missing macro definitions
On Thu, Jan 31, 2008 at 11:06:34PM +0800, WANG Cong wrote: This patch fixed the following build error in current -git tree. arch/um/kernel/config.c:10: error: expected declaration specifiers or '...' before '.' token ... This is close to uml-arch-um-include-inith-needs-a-definition-of-__used.patch that's currently in -mm. Andrew, could you replace uml-arch-um-include-inith-needs-a-definition-of-__used.patch with the version below and push it to Linus? Jeff -- Work email - jdike at linux dot intel dot com init.h started breaking now for some reason. It turns out that there wasn't a definition of __used. Fixed this by copying the relevant stuff from compiler.h in the userspace case, and including compiler.h in the kernel case. From WANG Cong [EMAIL PROTECTED] - added definition of __section Signed-off-by: Jeff Dike [EMAIL PROTECTED] Cc: WANG Cong [EMAIL PROTECTED] --- arch/um/include/init.h | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) Index: linux-2.6-git/arch/um/include/init.h === --- linux-2.6-git.orig/arch/um/include/init.h 2008-02-01 10:41:14.0 -0500 +++ linux-2.6-git/arch/um/include/init.h2008-02-01 10:52:34.0 -0500 @@ -40,6 +40,20 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); +#ifndef __KERNEL__ +#ifndef __section +# define __section(S) __attribute__ ((__section__(#S))) +#endif + +#if __GNUC_MINOR__ = 3 +# define __used__attribute__((__used__)) +#else +# define __used__attribute__((__unused__)) +#endif + +#else +#include linux/compiler.h +#endif /* These are for everybody (although not all archs will actually discard it in modules) */ #define __init __section(.init.text) @@ -127,14 +141,3 @@ extern struct uml_param __uml_setup_star #endif #endif /* _LINUX_UML_INIT_H */ - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --- - * Local variables: - * c-file-style: linux - * End: - */ -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch] arch/um/include/init.h: Fix missing macro definitions
This patch fixed the following build error in current -git tree. arch/um/kernel/config.c:10: error: expected declaration specifiers or '...' before '.' token ... Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/include/init.h b/arch/um/include/init.h index cebc6ca..70982e1 100644 --- a/arch/um/include/init.h +++ b/arch/um/include/init.h @@ -40,6 +40,18 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); +#ifndef __section +# define __section(S) __attribute__ ((__section__(#S))) +#endif + +#ifndef __used +#if __GNUC__ == 3 && __GNUC_MINOR__ == 2 +# define __used __attribute__((__unused__)) +#else +# define __used __attribute__((__used__)) +#endif +#endif + /* These are for everybody (although not all archs will actually discard it in modules) */ #define __init __section(.init.text) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch] arch/um/include/init.h: Fix missing macro definitions
This patch fixed the following build error in current -git tree. arch/um/kernel/config.c:10: error: expected declaration specifiers or '...' before '.' token ... Cc: Jeff Dike [EMAIL PROTECTED] Signed-off-by: WANG Cong [EMAIL PROTECTED] --- diff --git a/arch/um/include/init.h b/arch/um/include/init.h index cebc6ca..70982e1 100644 --- a/arch/um/include/init.h +++ b/arch/um/include/init.h @@ -40,6 +40,18 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); +#ifndef __section +# define __section(S) __attribute__ ((__section__(#S))) +#endif + +#ifndef __used +#if __GNUC__ == 3 __GNUC_MINOR__ == 2 +# define __used __attribute__((__unused__)) +#else +# define __used __attribute__((__used__)) +#endif +#endif + /* These are for everybody (although not all archs will actually discard it in modules) */ #define __init __section(.init.text) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/