lkml.org 
[lkml]   [2011]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] epoll: remove unnecessary bit operation in epoll_create1 syscall
From
On Wed, Jan 12, 2011 at 11:58 AM, Namhyung Kim <namhyung@gmail.com> wrote:
> @flags can have O_CLOEXEC only so bitwise AND is not necessary.
>
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
> ---
>  fs/eventpoll.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/eventpoll.c b/fs/eventpoll.c
> index 8cf07242067d..2e21fb85b8b6 100644
> --- a/fs/eventpoll.c
> +++ b/fs/eventpoll.c
> @@ -1209,7 +1209,7 @@ SYSCALL_DEFINE1(epoll_create1, int, flags)
>         * a file structure and a free file descriptor.
>         */
>        error = anon_inode_getfd("[eventpoll]", &eventpoll_fops, ep,
> -                                O_RDWR | (flags & O_CLOEXEC));
> +                                O_RDWR | flags);

I'm strong against this.
Whenever a new flag is allowed this will explode...

>        if (error < 0)
>                ep_free(ep);
>
> --
> 1.7.3.4.600.g982838b0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>



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

\
 
 \ /
  Last update: 2011-01-12 15:45    [W:0.036 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site