From: Arnd Bergmann <arnd@arndb.de>
To: Vineet.Gupta1@synopsys.com
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] asm-generic: uaccess: allow arch to over-ride __get_user_fn()
Date: Tue, 20 Nov 2012 15:55:37 +0000 [thread overview]
Message-ID: <201211201555.37272.arnd@arndb.de> (raw)
In-Reply-To: <1353422297-29079-2-git-send-email-vgupta@synopsys.com>
On Tuesday 20 November 2012, Vineet.Gupta1@synopsys.com wrote:
> +#ifndef __get_user_fn
> static inline int __get_user_fn(size_t size, const void __user *ptr, void *x)
> {
> size = __copy_from_user(x, ptr, size);
> return size ? -EFAULT : size;
> }
>
> +#define __get_user_fn(sz, u, k) __get_user_fn(sz, u, k)
> +
> +#endif
This is ok as well. The idea with the asm-generic __copy_from_user()
implementation is to separate out the cases where you have just
a few bytes and handle them efficiently inline. If you don't want
to do that for some reason, overriding __get_user_fn works
as well. The resulting object code should be the same.
Arnd
next prev parent reply other threads:[~2012-11-20 15:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 14:38 [PATCH 0/2] RFC only - allow arches to over-ride unit sized user copies Vineet.Gupta1
2012-11-20 14:38 ` [PATCH 1/2] asm-generic: uaccess: allow arch to over-ride __get_user_fn() Vineet.Gupta1
2012-11-20 14:38 ` Vineet.Gupta1
2012-11-20 15:55 ` Arnd Bergmann [this message]
2012-12-21 19:43 ` Arnd Bergmann
2012-12-24 5:50 ` Vineet Gupta
2012-11-20 14:38 ` [PATCH 2/2] ARC: provide optimal __get_user_fn() Vineet.Gupta1
2012-11-20 14:38 ` Vineet.Gupta1
2012-11-20 15:51 ` Arnd Bergmann
2012-12-21 4:33 ` Vineet Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201211201555.37272.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=Vineet.Gupta1@synopsys.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).