Skip to contentSkip to conversation

vdi: wrapped uuid_unparse() in #ifdef

PATCH Applied SeokYeon Hwang 4 participants 4 messages Oct 31, 2014 – Nov 3, 2014 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vdi: wrapped uuid_unparse() in #ifdef

Wrapped uuid_unparse() in #ifdef to avoid "-Wunused-function" on clang 3.4 or later.

---
 block/vdi.c | 2 ++
 1 file changed, 2 insertions(+)
block/vdi.c +2 -0
index 19701ee..e1d211c 100644
@@ -137,12 +137,14 @@ static inline int uuid_is_null(const uuid_t uu)
     return memcmp(uu, null_uuid, sizeof(uuid_t)) == 0;
 }
 
+# if defined(CONFIG_VDI_DEBUG)
 static inline void uuid_unparse(const uuid_t uu, char *out)
 {
     snprintf(out, 37, UUID_FMT,
             uu[0], uu[1], uu[2], uu[3], uu[4], uu[5], uu[6], uu[7],
             uu[8], uu[9], uu[10], uu[11], uu[12], uu[13], uu[14], uu[15]);
 }
+# endif
 #endif
 
 typedef struct {
Signature · 1 line
2.1.0
Reviewed-by on v1 1/1
#1 lore raw

Am 31.10.2014 um 09:02 schrieb SeokYeon Hwang:

Quoted 16 lines

Wrapped uuid_unparse() in #ifdef to avoid "-Wunused-function" on clang 3.4 or later.

---
  block/vdi.c | 2 ++
  1 file changed, 2 insertions(+)
block/vdi.c +1 -0
index 19701ee..e1d211c 100644
@@ -137,12 +137,14 @@ static inline int uuid_is_null(const uuid_t uu)
      return memcmp(uu, null_uuid, sizeof(uuid_t)) == 0;
  }
 
+# if defined(CONFIG_VDI_DEBUG)

block/vdi.c static inline int uuid_is_null(const uuid_t uu) · line 150

Quoted 10 lines
block/vdi.c +1 -0
  static inline void uuid_unparse(const uuid_t uu, char *out)
  {
      snprintf(out, 37, UUID_FMT,
              uu[0], uu[1], uu[2], uu[3], uu[4], uu[5], uu[6], uu[7],
              uu[8], uu[9], uu[10], uu[11], uu[12], uu[13], uu[14], uu[15]);
  }
+# endif
  #endif
 
  typedef struct {

This code is only used on build hosts without libuuid development header files, so the warning can be avoided by installing that header files. Nevertheless, I think it is fine for qemu-trivial.

#2 lore raw
In reply to SeokYeon Hwang
Quoted 1 line · SeokYeon Hwang

Wrapped uuid_unparse() in #ifdef to avoid "-Wunused-function" on clang 3.4 or later.

Applied to -trivial, after adding a newline into the commit message :) Thanks,

/mjt

Reviewed-by on v1 1/1
#3 lore raw
In reply to SeokYeon Hwang
Quoted 17 lines · SeokYeon Hwang

Wrapped uuid_unparse() in #ifdef to avoid "-Wunused-function" on clang 3.4 or later.

---
 block/vdi.c | 2 ++
 1 file changed, 2 insertions(+)
block/vdi.c +1 -0
index 19701ee..e1d211c 100644
@@ -137,12 +137,14 @@ static inline int uuid_is_null(const uuid_t uu)
     return memcmp(uu, null_uuid, sizeof(uuid_t)) == 0;
 }
 
+# if defined(CONFIG_VDI_DEBUG)

block/vdi.c static inline int uuid_is_null(const uuid_t uu) · line 150

Quoted 10 lines
block/vdi.c +1 -0
 static inline void uuid_unparse(const uuid_t uu, char *out)
 {
     snprintf(out, 37, UUID_FMT,
             uu[0], uu[1], uu[2], uu[3], uu[4], uu[5], uu[6], uu[7],
             uu[8], uu[9], uu[10], uu[11], uu[12], uu[13], uu[14], uu[15]);
 }
+# endif
 #endif
 
 typedef struct {