Skip to contentSkip to conversation

kvm tool: Remove the __stringify* defination from the util.h

PATCH Superseded Prasad Joshi 3 participants 5 messages Apr 15, 2011 – Apr 16, 2011 KVM

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm tool: Remove the __stringify* defination from the util.h

Include the Linux kernel header file linux/stringify.h file instead of redefining the __stringify* macros

---
 tools/kvm/include/kvm/util.h |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
tools/kvm/include/kvm/util.h +2 -3
index ae033cc..c308f3f 100644
@@ -1,3 +1,5 @@
+#include "../../../../include/linux/stringify.h"
+
 #ifndef KVM__UTIL_H
 #define KVM__UTIL_H
 
@@ -27,9 +29,6 @@
 #endif
 #endif
 
-#define __stringify_1(x)	#x
-#define __stringify(x)		__stringify_1(x)
-
 extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));
 extern void die_perror(const char *s) NORETURN;
 extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
Signature · 1 line
1.7.1
#1 lore raw
Quoted 13 lines · Prasad Joshi

Include the Linux kernel header file linux/stringify.h file instead of redefining the __stringify* macros

---
 tools/kvm/include/kvm/util.h |    5 ++---

 1 files changed, 2 insertions(+), 3 deletions(-)
tools/kvm/include/kvm/util.h +0 -0
index ae033cc..c308f3f 100644

tools/kvm/include/kvm/util.h line 1

Quoted 1 line
tools/kvm/include/kvm/util.h +1 -0
@@ -1,3 +1,5 @@
+#include "../../../../include/linux/stringify.h"

#include <linux/stringify.h> should just work, no?

Quoted 22 lines
tools/kvm/include/kvm/util.h +1 -4
+
  #ifndef KVM__UTIL_H
  #define KVM__UTIL_H
 
@@ -27,9 +29,6 @@
  #endif
  #endif
 
-#define __stringify_1(x)       #x
-#define __stringify(x)         __stringify_1(x)
-
  extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));
  extern void die_perror(const char *s) NORETURN;
  extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
--

1.7.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 9 lines · Pekka Enberg
Quoted 8 lines · Prasad Joshi

Include the Linux kernel header file linux/stringify.h file instead of redefining the __stringify* macros

---
 tools/kvm/include/kvm/util.h |    5 ++---

 1 files changed, 2 insertions(+), 3 deletions(-)
Quoted 8 lines

tools/kvm/include/kvm/util.h line 1

Quoted 6 lines
tools/kvm/include/kvm/util.h +1 -0
index ae033cc..c308f3f 100644
@@ -1,3 +1,5 @@
+#include "../../../../include/linux/stringify.h"

#include <linux/stringify.h> should just work, no?

Only if kernel headers are installed. Also, and perhaps more importantly, in the context of perf it was more robust to use the same kernel repo's source code that perf resides in - should there be any fixes needed it's a lot easier to remedy things.

Thanks,

Ingo

#3 lore raw
Quoted 21 lines · Ingo Molnar
Quoted 9 lines · Pekka Enberg
Quoted 8 lines · Prasad Joshi

Include the Linux kernel header file linux/stringify.h file instead of redefining the __stringify* macros

---
 tools/kvm/include/kvm/util.h |    5 ++---

 1 files changed, 2 insertions(+), 3 deletions(-)
Quoted 8 lines

tools/kvm/include/kvm/util.h line 1

Quoted 6 lines
tools/kvm/include/kvm/util.h +1 -0
index ae033cc..c308f3f 100644
@@ -1,3 +1,5 @@
+#include "../../../../include/linux/stringify.h"

#include <linux/stringify.h> should just work, no?

Quoted 4 lines

Only if kernel headers are installed. Also, and perhaps more importantly, in the context of perf it was more robust to use the same kernel repo's source code that perf resides in - should there be any fixes needed it's a lot easier to remedy things.

We do this in the Makefile:

-I../../include -I../../arch/$(ARCH)/include/

so it should just work.

#4 lore raw
Quoted 28 lines · Pekka Enberg
Quoted 21 lines · Ingo Molnar
Quoted 9 lines · Pekka Enberg
Quoted 8 lines · Prasad Joshi

Include the Linux kernel header file linux/stringify.h file instead of redefining the __stringify* macros

---
 tools/kvm/include/kvm/util.h |    5 ++---

 1 files changed, 2 insertions(+), 3 deletions(-)
Quoted 8 lines

tools/kvm/include/kvm/util.h line 1

Quoted 6 lines
tools/kvm/include/kvm/util.h +1 -0
index ae033cc..c308f3f 100644
@@ -1,3 +1,5 @@
+#include "../../../../include/linux/stringify.h"

#include <linux/stringify.h> should just work, no?

Quoted 4 lines

Only if kernel headers are installed. Also, and perhaps more importantly, in the context of perf it was more robust to use the same kernel repo's source code that perf resides in - should there be any fixes needed it's a lot easier to remedy things.

Quoted 5 lines

We do this in the Makefile:

-I../../include -I../../arch/$(ARCH)/include/

so it should just work.

Oh, nice! :-)

Thanks,

Ingo