On Sun Apr 1 21:48:49 PDT 2007, Simon Horman wrote:
> On Thu, Mar 29, 2007 at 05:41:45PM -0700, Andrew Morton wrote:
> > On Thu, 29 Mar 2007 12:30:59 +0900
> > Simon Horman <horms at verge.net.au> wrote:
> > > [PATCH] kdump/kexec: calculate note size at compile time
> >
> > i386 allmodconfig, gcc-4.1.0:
> >
> > In file included from init/initramfs.c:508:
> > include/linux/kexec.h:148: error: variable-size type declared 
> outside of any function
>
> Hi,
>
> this problem appears to be caused by the use of strlen() inside the
> definition of KEXEC_NOTE_NAME_BYTES. I have removed this and the patch
> now compiles cleanly using gcc 4.1.2 on i386 allmodconfig, which
> previously gave the same error as above.

>  +#define KEXEC_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4)
> +#define KEXEC_NOTE_NAME_BYTES 8 /* ALIGN(strlen("CORE") + 1, 4) */
> +#define KEXEC_NOTE_DESC_BYTES ALIGN(sizeof(struct elf_prstatus), 4)
> +#define KEXEC_NOTE_BYTES ( (KEXEC_NOTE_HEAD_BYTES * 2) + \
> +                          KEXEC_NOTE_NAME_BYTES + 
> KEXEC_NOTE_DESC_BYTES )
> +
>

How about sizeof(KEXEC_NOTE_NAME) since that should both be compile 
constant
and include the strlen+1.

Also, a comment why its NOTE_HEAD_BYTES * 2   ... or add it twice, the 
second
time at the end, mirroring how its used.

milton

_______________________________________________
fastboot mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/fastboot

Reply via email to