Skip to contentSkip to conversation

virtio: Move extern declaration to header file

PATCH Applied Stefan Weil 2 participants 3 messages Jul 7, 2014 – Aug 2, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio: Move extern declaration to header file

This fixes a warning from smatch (static code analyser).

---
 hw/virtio/vhost-backend.c         |    2 --
 include/hw/virtio/vhost-backend.h |    2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)
hw/virtio/vhost-backend.c +0 -2
index 35316c4..ff4f200 100644
@@ -14,8 +14,6 @@
 
 #include <sys/ioctl.h>
 
-extern const VhostOps user_ops;
-
 static int vhost_kernel_call(struct vhost_dev *dev, unsigned long int request,
                              void *arg)
 {
include/hw/virtio/vhost-backend.h +2 -0
index d31768a..e472f29 100644
@@ -32,6 +32,8 @@ typedef struct VhostOps {
     vhost_backend_cleanup vhost_backend_cleanup;
 } VhostOps;
 
+extern const VhostOps user_ops;
+
 int vhost_set_backend_type(struct vhost_dev *dev,
                            VhostBackendType backend_type);
 
Signature · 1 line
1.7.10.4
#2 lore raw
In reply to Stefan Weil

07.07.2014 23:13, Stefan Weil wrote:
[]

hw/virtio/vhost-backend.c line 18

Quoted 9 lines

index 35316c4..ff4f200 100644

hw/virtio/vhost-backend.c +0 -2
@@ -14,8 +14,6 @@
 
 #include <sys/ioctl.h>
 
-extern const VhostOps user_ops;
-

BTW, it looks like we still have just one VhostOps - this user_ops one - despite commit 24d1eb33eb2ccd995a which was aimed to add another ops (kernel) back in May. Maybe we should not add extra indirection without a reason, before it is actually used?

Also, "user_ops" is way too generic name. Maybe user_vhost_ops or something.

Just.. saying.

Thanks,

/mjt