[kvm-unit-tests PATCH v2 1/5] libcflag: define the "noinline" macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Define "noline" macro to reduce the amount of typing for functions using
the "noinline" attribute.

Signed-off-by: Bill Wendling <morbo@xxxxxxxxxx>
---
v2: Combine separate change with this series.
---
 lib/libcflat.h | 1 +
 x86/pmu_lbr.c  | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/libcflat.h b/lib/libcflat.h
index 97db9e3..a652c76 100644
--- a/lib/libcflat.h
+++ b/lib/libcflat.h
@@ -29,6 +29,7 @@
 #include <stdbool.h>
 
 #define __unused __attribute__((__unused__))
+#define noinline __attribute__((noinline))
 
 #define xstr(s...) xxstr(s)
 #define xxstr(s...) #s
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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux