From: Darren Hart <dvhart@linux.intel.com>
To: Chris Metcalf <cmetcalf@tilera.com>
Cc: linux-kernel@vger.kernel.org, Michel Lespinasse <walken@google.com>
Subject: Re: [PATCH] arch/tile: fix futex sanitization definition/prototype mismatch
Date: Mon, 21 Mar 2011 19:46:06 -0700 [thread overview]
Message-ID: <4D880D6E.9000501@linux.intel.com> (raw)
In-Reply-To: <201103191553.p2JFrWG9010986@farm-0023.internal.tilera.com>
On 03/19/2011 08:45 AM, Chris Metcalf wrote:
> Commit 8d7718aa082aaf30a0b4989e1f04858952f941bc changed "int"
> to "u32" in the prototypes but not the definition.
> I missed this when I saw the patch go by on LKML.
>
> We cast "u32 *" to "int *" since we are tying into the underlying
> atomics framework, and atomic_t uses int as its value type.
>
> Signed-off-by: Chris Metcalf<cmetcalf@tilera.com>
Should we have caught this with a compiler warning (mismatch definition
and prototype) ? If not, why not?
Compile and boot tested?
Acked-by: Darren Hart <dvhart@linux.intel.com>
> ---
> arch/tile/lib/atomic_32.c | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/tile/lib/atomic_32.c b/arch/tile/lib/atomic_32.c
> index f02040d..4657021 100644
> --- a/arch/tile/lib/atomic_32.c
> +++ b/arch/tile/lib/atomic_32.c
> @@ -202,32 +202,32 @@ static inline int *__futex_setup(int __user *v)
> return __atomic_hashed_lock((int __force *)v);
> }
>
> -struct __get_user futex_set(int __user *v, int i)
> +struct __get_user futex_set(u32 __user *v, int i)
> {
> return __atomic_xchg((int __force *)v, __futex_setup(v), i);
> }
>
> -struct __get_user futex_add(int __user *v, int n)
> +struct __get_user futex_add(u32 __user *v, int n)
> {
> return __atomic_xchg_add((int __force *)v, __futex_setup(v), n);
> }
>
> -struct __get_user futex_or(int __user *v, int n)
> +struct __get_user futex_or(u32 __user *v, int n)
> {
> return __atomic_or((int __force *)v, __futex_setup(v), n);
> }
>
> -struct __get_user futex_andn(int __user *v, int n)
> +struct __get_user futex_andn(u32 __user *v, int n)
> {
> return __atomic_andn((int __force *)v, __futex_setup(v), n);
> }
>
> -struct __get_user futex_xor(int __user *v, int n)
> +struct __get_user futex_xor(u32 __user *v, int n)
> {
> return __atomic_xor((int __force *)v, __futex_setup(v), n);
> }
>
> -struct __get_user futex_cmpxchg(int __user *v, int o, int n)
> +struct __get_user futex_cmpxchg(u32 __user *v, int o, int n)
> {
> return __atomic_cmpxchg((int __force *)v, __futex_setup(v), o, n);
> }
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
next prev parent reply other threads:[~2011-03-22 2:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-19 15:45 [PATCH] arch/tile: fix futex sanitization definition/prototype mismatch Chris Metcalf
2011-03-20 3:52 ` Michel Lespinasse
2011-03-22 2:46 ` Darren Hart [this message]
2011-03-22 13:43 ` Chris Metcalf
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=4D880D6E.9000501@linux.intel.com \
--to=dvhart@linux.intel.com \
--cc=cmetcalf@tilera.com \
--cc=linux-kernel@vger.kernel.org \
--cc=walken@google.com \
/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