lkml.org 
[lkml]   [2014]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] x86: Get rid of __HAVE_ARCH_CMPXCHG
From
On Fri, Jul 11, 2014 at 11:51 AM, Borislav Petkov <bp@alien8.de> wrote:
> From: Borislav Petkov <bp@suse.de>
>
> Both the 32-bit and 64-bit cmpxchg.h header define __HAVE_ARCH_CMPXCHG
> and there's ifdeffery which checks it. But since both bitness define it,
> we can just as well drop it and simpify a bit of code in doing that.
>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
> arch/x86/include/asm/cmpxchg.h | 2 --
> arch/x86/include/asm/cmpxchg_32.h | 2 --
> arch/x86/include/asm/cmpxchg_64.h | 2 --
> arch/x86/include/asm/mc146818rtc.h | 2 +-
> arch/x86/include/asm/mutex_32.h | 16 ++--------------
> arch/x86/kernel/acpi/boot.c | 4 ----
> kernel/locking/rtmutex.c | 2 +-
> 7 files changed, 4 insertions(+), 26 deletions(-)

> --- a/kernel/locking/rtmutex.c
> +++ b/kernel/locking/rtmutex.c
> @@ -73,7 +73,7 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock)
> * We can speed up the acquire/release, if the architecture
> * supports cmpxchg and if there's no debugging state to be set up
> */
> -#if defined(__HAVE_ARCH_CMPXCHG) && !defined(CONFIG_DEBUG_RT_MUTEXES)
> +#ifndef CONFIG_DEBUG_RT_MUTEXES
> # define rt_mutex_cmpxchg(l,c,n) (cmpxchg(&l->owner, c, n) == c)
> static inline void mark_rt_mutex_waiters(struct rt_mutex *lock)
> {

What about non-x86? __HAVE_ARCH_CMPXCHG isn't always defined.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


\
 
 \ /
  Last update: 2014-07-11 13:01    [W:0.056 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site