diff mbox

virtio: Move extern declaration to header file

Message ID 1404760407-1554-1-git-send-email-sw@weilnetz.de
State Accepted
Headers show

Commit Message

Stefan Weil July 7, 2014, 7:13 p.m. UTC
This fixes a warning from smatch (static code analyser).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 hw/virtio/vhost-backend.c         |    2 --
 include/hw/virtio/vhost-backend.h |    2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Michael Tokarev Aug. 2, 2014, 1:27 p.m. UTC | #1
Applied to -trivial, thanks!

/mjt
Michael Tokarev Aug. 2, 2014, 1:31 p.m. UTC | #2
07.07.2014 23:13, Stefan Weil wrote:
[]
> index 35316c4..ff4f200 100644
> --- a/hw/virtio/vhost-backend.c
> +++ b/hw/virtio/vhost-backend.c
> @@ -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
diff mbox

Patch

diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
index 35316c4..ff4f200 100644
--- a/hw/virtio/vhost-backend.c
+++ b/hw/virtio/vhost-backend.c
@@ -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)
 {
diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h
index d31768a..e472f29 100644
--- a/include/hw/virtio/vhost-backend.h
+++ b/include/hw/virtio/vhost-backend.h
@@ -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);