Skip to contentSkip to conversation

tools/virtio: move module license stub to module.h

PATCH Applied Michael S. Tsirkin 2 participants 2 messages Jul 7, 2013 – Jul 8, 2013

Subsystems (2)
lore
Share & tools
lore

Michael S. Tsirkin

author maintainer
#0 lore raw

PATCH 1/1 tools/virtio: move module license stub to module.h

This fixes build for the vringh test:
[linux]$ make -C tools/virtio/
make: Entering directory `/home/mst/scm/linux/tools/virtio' cc -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD
-U_FORTIFY_SOURCE -c -o vringh.o ../../drivers/vhost/vringh.c
../../drivers/vhost/vringh.c:1010:16: error: expected declaration specifiers or ‘...’ before string constant

---
 tools/virtio/linux/module.h | 5 +++++
 tools/virtio/linux/virtio.h | 3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)
tools/virtio/linux/module.h +5 -0
index 3039a7e..28ce95a 100644
@@ -1 +1,6 @@
 #include <linux/export.h>
+
+#define MODULE_LICENSE(__MODULE_LICENSE_value) \
+	static __attribute__((unused)) const char *__MODULE_LICENSE_name = \
+		__MODULE_LICENSE_value
+
tools/virtio/linux/virtio.h +0 -3
index cd80183..8447830 100644
@@ -45,9 +45,6 @@ struct virtqueue {
 	void *priv;
 };
 
-#define MODULE_LICENSE(__MODULE_LICENSE_value) \
-	const char *__MODULE_LICENSE_name = __MODULE_LICENSE_value
-
 /* Interfaces exported by virtio_ring. */
 int virtqueue_add_sgs(struct virtqueue *vq,
 		      struct scatterlist *sgs[],
Signature · 1 line
MST
#1 lore raw
Quoted 9 lines · Michael S. Tsirkin

This fixes build for the vringh test:
[linux]$ make -C tools/virtio/
make: Entering directory `/home/mst/scm/linux/tools/virtio' cc -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign

(quoted diff) +0 -2
-fno-strict-overflow -fno-strict-aliasing -fno-common -MMD
-U_FORTIFY_SOURCE   -c -o vringh.o ../../drivers/vhost/vringh.c

../../drivers/vhost/vringh.c:1010:16: error: expected declaration specifiers or ‘...’ before string constant

Quoted 5 lines
---
 tools/virtio/linux/module.h | 5 +++++
 tools/virtio/linux/virtio.h | 3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

Applied, thanks.

Cheers,
Rusty.

Quoted 27 lines
tools/virtio/linux/module.h +5 -0
index 3039a7e..28ce95a 100644
@@ -1 +1,6 @@
 #include <linux/export.h>
+
+#define MODULE_LICENSE(__MODULE_LICENSE_value) \
+	static __attribute__((unused)) const char *__MODULE_LICENSE_name = \
+		__MODULE_LICENSE_value
+
tools/virtio/linux/virtio.h +0 -3
index cd80183..8447830 100644
@@ -45,9 +45,6 @@ struct virtqueue {
 	void *priv;
 };
 
-#define MODULE_LICENSE(__MODULE_LICENSE_value) \
-	const char *__MODULE_LICENSE_name = __MODULE_LICENSE_value
-
 /* Interfaces exported by virtio_ring. */
 int virtqueue_add_sgs(struct virtqueue *vq,
 		      struct scatterlist *sgs[],
Signature · 1 line
MST

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization