Re: [PATCH] autofs4: fix compilation without CONFIG_COMPAT

From: H. Peter Anvin
Date: Sat Feb 25 2012 - 20:48:06 EST


On 02/25/2012 05:31 PM, Linus Torvalds wrote:
> On Sat, Feb 25, 2012 at 2:10 PM, Andreas Schwab <schwab@xxxxxxxxxxxxxx> wrote:
>> The compat_daemon stuff is only needed on x86-64, and is_compat_task is
>> only defined with CONFIG_COMPAT, so disable it for all other
>> configurations.
>
> Ugh, I hate the proliferation of #ifdefs in code when they aren't
> really necessary.
>
> How about this patch instead? It's small, simple, and clean. Maybe it
> would even allow a few other #ifdef's to be removed (I see one in
> kernel/seccomp.c, for example, although I suspect that
> 'mode1_syscalls_32' might also be a compat-only thing, so who knows)
>
> And if you worry about the size of autofs_sb_info, I think that could
> be made denser by using 'char' or bitfields instead of the various
> ints that hold small values or flags instead.
>

I think this patch could help clean up other places, too.

-hpa


--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

--
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/