All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bill Wendling <morbo@google.com>
To: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Roman Bolshakov <r.bolshakov@yadro.com>,
	David Matlack <dmatlack@google.com>,
	Sean Christopherson <seanjc@google.com>
Cc: Bill Wendling <morbo@google.com>
Subject: [PATCH] libcflag: define the "noinline" macro
Date: Thu, 26 Aug 2021 14:04:06 -0700	[thread overview]
Message-ID: <20210826210406.18490-1-morbo@google.com> (raw)

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

Signed-off-by: Bill Wendling <morbo@google.com>
---
 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.259.gc128427fd7-goog


             reply	other threads:[~2021-08-26 21:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 21:04 Bill Wendling [this message]
2021-08-27 21:00 ` [PATCH] libcflag: define the "noinline" macro Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210826210406.18490-1-morbo@google.com \
    --to=morbo@google.com \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=r.bolshakov@yadro.com \
    --cc=seanjc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.