From: Bill Wendling <morbo@xxxxxxxxxx> Define "noline" macro to reduce the amount of typing for functions using the "noinline" attribute. Opportunsitically convert existing users. Signed-off-by: Bill Wendling <morbo@xxxxxxxxxx> [sean: put macro in compiler.h instead of libcflat.h] Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx> --- lib/linux/compiler.h | 1 + x86/pmu_lbr.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/linux/compiler.h b/lib/linux/compiler.h index 5d9552a..5937b7b 100644 --- a/lib/linux/compiler.h +++ b/lib/linux/compiler.h @@ -46,6 +46,7 @@ #define barrier() asm volatile("" : : : "memory") #define __always_inline inline __attribute__((always_inline)) +#define noinline __attribute__((noinline)) static __always_inline void __read_once_size(const volatile void *p, void *res, int size) { diff --git a/x86/pmu_lbr.c b/x86/pmu_lbr.c index 3bd9e9f..5ff805a 100644 --- a/x86/pmu_lbr.c +++ b/x86/pmu_lbr.c @@ -16,14 +16,14 @@ volatile int count; -static __attribute__((noinline)) int compute_flag(int i) +static noinline int compute_flag(int i) { if (i % 10 < 4) return i + 1; return 0; } -static __attribute__((noinline)) int lbr_test(void) +static noinline int lbr_test(void) { int i; int flag; -- 2.33.0.309.g3052b89438-goog