From e6122fb5135c48e22727bae35a4370941f1b08c7 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Mon, 12 Jan 2009 23:01:15 +0100 Subject: [PATCH] --- yaml --- r: 129947 b: refs/heads/master c: c8399943bdb70fef78798b97f975506ecc99e039 h: refs/heads/master i: 129945: 0fcaa27be361d56ab788df4f09eee30b91933793 129943: f808f9bd370530ef9670d41e4c2662625ad3ecac v: v3 --- [refs] | 2 +- trunk/arch/x86/include/asm/bitops.h | 14 ++++++++++---- trunk/include/asm-generic/bitops/__ffs.h | 2 +- trunk/include/asm-generic/bitops/__fls.h | 2 +- trunk/include/asm-generic/bitops/fls.h | 2 +- trunk/include/asm-generic/bitops/fls64.h | 4 ++-- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 34b819fa6775..b48dd38c2740 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4a922a969cb0190ce4580d4b064e2ac35f3ac9bf +refs/heads/master: c8399943bdb70fef78798b97f975506ecc99e039 diff --git a/trunk/arch/x86/include/asm/bitops.h b/trunk/arch/x86/include/asm/bitops.h index e02a359d2aa5..02b47a603fc8 100644 --- a/trunk/arch/x86/include/asm/bitops.h +++ b/trunk/arch/x86/include/asm/bitops.h @@ -3,6 +3,9 @@ /* * Copyright 1992, Linus Torvalds. + * + * Note: inlines with more than a single statement should be marked + * __always_inline to avoid problems with older gcc's inlining heuristics. */ #ifndef _LINUX_BITOPS_H @@ -53,7 +56,8 @@ * Note that @nr may be almost arbitrarily large; this function is not * restricted to acting on a single-word quantity. */ -static inline void set_bit(unsigned int nr, volatile unsigned long *addr) +static __always_inline void +set_bit(unsigned int nr, volatile unsigned long *addr) { if (IS_IMMEDIATE(nr)) { asm volatile(LOCK_PREFIX "orb %1,%0" @@ -90,7 +94,8 @@ static inline void __set_bit(int nr, volatile unsigned long *addr) * you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit() * in order to ensure changes are visible on other processors. */ -static inline void clear_bit(int nr, volatile unsigned long *addr) +static __always_inline void +clear_bit(int nr, volatile unsigned long *addr) { if (IS_IMMEDIATE(nr)) { asm volatile(LOCK_PREFIX "andb %1,%0" @@ -204,7 +209,8 @@ static inline int test_and_set_bit(int nr, volatile unsigned long *addr) * * This is the same as test_and_set_bit on x86. */ -static inline int test_and_set_bit_lock(int nr, volatile unsigned long *addr) +static __always_inline int +test_and_set_bit_lock(int nr, volatile unsigned long *addr) { return test_and_set_bit(nr, addr); } @@ -300,7 +306,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr) return oldbit; } -static inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr) +static __always_inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr) { return ((1UL << (nr % BITS_PER_LONG)) & (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0; diff --git a/trunk/include/asm-generic/bitops/__ffs.h b/trunk/include/asm-generic/bitops/__ffs.h index 9a3274aecf83..937d7c435575 100644 --- a/trunk/include/asm-generic/bitops/__ffs.h +++ b/trunk/include/asm-generic/bitops/__ffs.h @@ -9,7 +9,7 @@ * * Undefined if no bit exists, so code should check against 0 first. */ -static inline unsigned long __ffs(unsigned long word) +static __always_inline unsigned long __ffs(unsigned long word) { int num = 0; diff --git a/trunk/include/asm-generic/bitops/__fls.h b/trunk/include/asm-generic/bitops/__fls.h index be24465403d6..a60a7ccb6782 100644 --- a/trunk/include/asm-generic/bitops/__fls.h +++ b/trunk/include/asm-generic/bitops/__fls.h @@ -9,7 +9,7 @@ * * Undefined if no set bit exists, so code should check against 0 first. */ -static inline unsigned long __fls(unsigned long word) +static __always_inline unsigned long __fls(unsigned long word) { int num = BITS_PER_LONG - 1; diff --git a/trunk/include/asm-generic/bitops/fls.h b/trunk/include/asm-generic/bitops/fls.h index 850859bc5069..0576d1f42f43 100644 --- a/trunk/include/asm-generic/bitops/fls.h +++ b/trunk/include/asm-generic/bitops/fls.h @@ -9,7 +9,7 @@ * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. */ -static inline int fls(int x) +static __always_inline int fls(int x) { int r = 32; diff --git a/trunk/include/asm-generic/bitops/fls64.h b/trunk/include/asm-generic/bitops/fls64.h index 86d403f8b256..b097cf8444e3 100644 --- a/trunk/include/asm-generic/bitops/fls64.h +++ b/trunk/include/asm-generic/bitops/fls64.h @@ -15,7 +15,7 @@ * at position 64. */ #if BITS_PER_LONG == 32 -static inline int fls64(__u64 x) +static __always_inline int fls64(__u64 x) { __u32 h = x >> 32; if (h) @@ -23,7 +23,7 @@ static inline int fls64(__u64 x) return fls(x); } #elif BITS_PER_LONG == 64 -static inline int fls64(__u64 x) +static __always_inline int fls64(__u64 x) { if (x == 0) return 0;