Re: [PATCH] x86: slightly shorten __ticket_spin_trylock() (v2)

From: Ingo Molnar
Date: Thu Dec 03 2009 - 05:49:27 EST



* Jan Beulich <JBeulich@xxxxxxxxxx> wrote:

> Since the callers generally expect a boolean value, there's no need to
> zero-extend the outcome of the comparison. It just requires that all
> of x86' trylock implementations have their return type changed
> accordingly.
>
> Don't use bool for the return type though - this is being frowned on
> and presently doesn't work with the pv-ops patching macros.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
> Cc: Nick Piggin <npiggin@xxxxxxx>
> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
>
> ---
> arch/x86/include/asm/paravirt.h | 4 ++--
> arch/x86/include/asm/paravirt_types.h | 2 +-
> arch/x86/include/asm/spinlock.h | 12 +++++-------
> arch/x86/xen/spinlock.c | 2 +-
> 4 files changed, 9 insertions(+), 11 deletions(-)

Looks much cleaner - and should give us pretty much the same savings as
the previous patch, right? (if not, do you have a size comparison?)

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