lkml.org 
[lkml]   [2012]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: [PATCH] autofs4: fix compilation without CONFIG_COMPAT
On Sat, Feb 25, 2012 at 2:10 PM, Andreas Schwab <schwab@linux-m68k.org> 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.

Linus
include/linux/compat.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/linux/compat.h b/include/linux/compat.h
index 41c9f6515f46..7e05fcee75a1 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -561,5 +561,9 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid,
unsigned long liovcnt, const struct compat_iovec __user *rvec,
unsigned long riovcnt, unsigned long flags);

+#else
+
+#define is_compat_task() (0)
+
#endif /* CONFIG_COMPAT */
#endif /* _LINUX_COMPAT_H */
\
 
 \ /
  Last update: 2012-02-26 02:35    [W:0.127 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site