Re: [PATCH v3 1/2] init: add sys-wrapper.h

From: Sam Ravnborg
Date: Tue Aug 31 2010 - 10:30:21 EST


>
> /*
> * wrappers for various syscalls for use in the init code
> *
> * Copyright (C) 2010 Namhyung Kim <namhyung@xxxxxxxxx>
> *
> * This file is released under the GPLv2.
> */
>
> #include <linux/syscalls.h>
> #include <linux/dirent.h>
> #include <linux/types.h>
> #include <linux/fs.h>
>
> #include <asm/uaccess.h>
>

Good.
Except that we usually recommend to include files from include/linux
if thye exist rather than asm/xxx

So use: #include <linux/uaccess.h>


>
> >> +
> >> +#define kern_sys_call(call, ...)             \
> >> +({                                           \
> >> +     long result;                            \
> >> +     mm_segment_t old_fs = get_fs();         \
> >> +     set_fs(KERNEL_DS);                      \
> >> +     result = call(__VA_ARGS__);             \
> >> +     set_fs(old_fs);                         \
> >> +     result;                                 \
> >> +})
> >> +
> >
> > Personal preference...
> > Replace kern_ with kernel_ all over.
> >
>
> Is this just your preference or general tendency?
I asked git:
$ git grep kern_ | wc -l
962
$ git grep kernel_ | wc -l
6361

There seems to be preference for kernel_

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