Re: [tip:x86/asm] x86, 64-bit: ifdef out struct thread_struct::ip

From: Ingo Molnar
Date: Mon May 11 2009 - 15:28:43 EST



* Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:

> On Mon, May 11, 2009 at 8:03 PM, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> > On Mon, May 11, 2009 at 03:09:40PM +0000, tip-bot for Alexey Dobriyan wrote:
> >> +#ifdef CONFIG_X86_32
> >>       unsigned long           ip;
> >> +#endif
> >>  #ifdef CONFIG_X86_64
> >>       unsigned long           fs;
> >>  #endif
> >
> > What happened to the good old concept of #if #else #endif?
>
> #else suggests alternative which is not the case.
> ->ip and ->fs can be in different parts of thread_struct.

Yes, it's cleaner to have them separate. #if / #else / #endif would
be shorter by one line, and it would be thicker by a big confusion
factor: "why is fs the alternative on 64-bit of 32-bit's ip??"

They could also move apart later on, if structure packing
constraints call for it.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/