All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] tcg: mark tcg_out* and tcg_patch* with attribute 'unused'
@ 2014-06-07 17:08 ` Peter Maydell
  0 siblings, 0 replies; 12+ messages in thread
From: Peter Maydell @ 2014-06-07 17:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Richard Henderson, patches

The tcg_out* and tcg_patch* functions are utility routines that may or
may not be used by a particular backend; mark them with the 'unused'
attribute to suppress spurious warnings if they aren't used.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Do we want to define a QEMU_UNUSED macro in compiler.h? We don't
seem to have done for the existing uses of this attribute in tree.

 tcg/tcg.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 2c5732d..fe55d05 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -125,19 +125,20 @@ static TCGRegSet tcg_target_available_regs[2];
 static TCGRegSet tcg_target_call_clobber_regs;
 
 #if TCG_TARGET_INSN_UNIT_SIZE == 1
-static inline void tcg_out8(TCGContext *s, uint8_t v)
+static __attribute__((unused)) inline void tcg_out8(TCGContext *s, uint8_t v)
 {
     *s->code_ptr++ = v;
 }
 
-static inline void tcg_patch8(tcg_insn_unit *p, uint8_t v)
+static __attribute__((unused)) inline void tcg_patch8(tcg_insn_unit *p,
+                                                      uint8_t v)
 {
     *p = v;
 }
 #endif
 
 #if TCG_TARGET_INSN_UNIT_SIZE <= 2
-static inline void tcg_out16(TCGContext *s, uint16_t v)
+static __attribute__((unused)) inline void tcg_out16(TCGContext *s, uint16_t v)
 {
     if (TCG_TARGET_INSN_UNIT_SIZE == 2) {
         *s->code_ptr++ = v;
@@ -148,7 +149,8 @@ static inline void tcg_out16(TCGContext *s, uint16_t v)
     }
 }
 
-static inline void tcg_patch16(tcg_insn_unit *p, uint16_t v)
+static __attribute__((unused)) inline void tcg_patch16(tcg_insn_unit *p,
+                                                       uint16_t v)
 {
     if (TCG_TARGET_INSN_UNIT_SIZE == 2) {
         *p = v;
@@ -159,7 +161,7 @@ static inline void tcg_patch16(tcg_insn_unit *p, uint16_t v)
 #endif
 
 #if TCG_TARGET_INSN_UNIT_SIZE <= 4
-static inline void tcg_out32(TCGContext *s, uint32_t v)
+static __attribute__((unused)) inline void tcg_out32(TCGContext *s, uint32_t v)
 {
     if (TCG_TARGET_INSN_UNIT_SIZE == 4) {
         *s->code_ptr++ = v;
@@ -170,7 +172,8 @@ static inline void tcg_out32(TCGContext *s, uint32_t v)
     }
 }
 
-static inline void tcg_patch32(tcg_insn_unit *p, uint32_t v)
+static __attribute__((unused)) inline void tcg_patch32(tcg_insn_unit *p,
+                                                       uint32_t v)
 {
     if (TCG_TARGET_INSN_UNIT_SIZE == 4) {
         *p = v;
@@ -181,7 +184,7 @@ static inline void tcg_patch32(tcg_insn_unit *p, uint32_t v)
 #endif
 
 #if TCG_TARGET_INSN_UNIT_SIZE <= 8
-static inline void tcg_out64(TCGContext *s, uint64_t v)
+static __attribute__((unused)) inline void tcg_out64(TCGContext *s, uint64_t v)
 {
     if (TCG_TARGET_INSN_UNIT_SIZE == 8) {
         *s->code_ptr++ = v;
@@ -192,7 +195,8 @@ static inline void tcg_out64(TCGContext *s, uint64_t v)
     }
 }
 
-static inline void tcg_patch64(tcg_insn_unit *p, uint64_t v)
+static __attribute__((unused)) inline void tcg_patch64(tcg_insn_unit *p,
+                                                       uint64_t v)
 {
     if (TCG_TARGET_INSN_UNIT_SIZE == 8) {
         *p = v;
-- 
1.8.5.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-06-21 15:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-07 17:08 [Qemu-trivial] [PATCH] tcg: mark tcg_out* and tcg_patch* with attribute 'unused' Peter Maydell
2014-06-07 17:08 ` [Qemu-devel] " Peter Maydell
2014-06-08 12:11 ` [Qemu-trivial] " Michael Tokarev
2014-06-08 12:11   ` [Qemu-devel] " Michael Tokarev
2014-06-08 12:33   ` Peter Maydell
2014-06-08 12:33     ` [Qemu-devel] " Peter Maydell
2014-06-08 19:04   ` Peter Maydell
2014-06-08 19:04     ` [Qemu-devel] " Peter Maydell
2014-06-08 19:34     ` Richard Henderson
2014-06-08 19:34       ` [Qemu-devel] " Richard Henderson
2014-06-21 15:11 ` Michael Tokarev
2014-06-21 15:11   ` [Qemu-devel] " Michael Tokarev

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.