[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTikak7E1otZ3Uffiz2hRvOGrPe6kLcDp3tM69QM_@mail.gmail.com>
Date: Wed, 15 Sep 2010 08:14:49 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Christopher Yeoh <cyeoh@....ibm.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH] Cross Memory Attach
On Wed, Sep 15, 2010 at 8:11 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> Btw, please just do this as
>
> if (copy_to)
> ret = copy_from_user(..);
> else
> ret = copy_to_user(..);
> kunmap(process_pages[i]);
> if (ret)
> goto out;
In fact, you might consider passing in a "copy_out" function pointer
rather than that "copy_to" boolean, and rather than that conditional,
just do a
ret = copy_out(..);
thing. On sane/good architectures, branch target prediction will make
it all work out to the same work in the end, and it certainly looks
simpler and cleaner.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists