diff mbox

virtio: include asm/barrier explicitly

Message ID 20130707142019.GA2447@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael S. Tsirkin July 7, 2013, 2:20 p.m. UTC
virtio_ring.h uses mb() and friends, make
it pull in asm/barrier.h itself, not rely
on other headers to do it.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/linux/virtio_ring.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael S. Tsirkin July 7, 2013, 2:21 p.m. UTC | #1
On Sun, Jul 07, 2013 at 05:20:19PM +0300, Michael S. Tsirkin wrote:
> virtio_ring.h uses mb() and friends, make
> it pull in asm/barrier.h itself, not rely
> on other headers to do it.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

In particular this fixes warnings during test build:
[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 virtio_test.o virtio_test.c
In file included from ./linux/virtio_ring.h:1:0,
                 from ../../usr/include/linux/vhost.h:17,
                 from virtio_test.c:14:
./linux/../../../include/linux/virtio_ring.h: In function ‘virtio_mb’:
./linux/../../../include/linux/virtio_ring.h:50:2: warning: implicit
declaration of function ‘mb’ [-Wimplicit-function-declaration]


> ---
>  include/linux/virtio_ring.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
> index ca3ad41..b300787 100644
> --- a/include/linux/virtio_ring.h
> +++ b/include/linux/virtio_ring.h
> @@ -1,6 +1,7 @@
>  #ifndef _LINUX_VIRTIO_RING_H
>  #define _LINUX_VIRTIO_RING_H
>  
> +#include <asm/barrier.h>
>  #include <linux/irqreturn.h>
>  #include <uapi/linux/virtio_ring.h>
>  
> -- 
> MST
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rusty Russell July 8, 2013, 2:01 a.m. UTC | #2
"Michael S. Tsirkin" <mst@redhat.com> writes:
> virtio_ring.h uses mb() and friends, make
> it pull in asm/barrier.h itself, not rely
> on other headers to do it.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Applied.

Thanks,
Rusty.
PS.  I'll squeeze these into this merge window, since they're trivial.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Rothwell July 8, 2013, 5:33 a.m. UTC | #3
Hi Rusty,

On Mon, 08 Jul 2013 11:31:45 +0930 Rusty Russell <rusty@rustcorp.com.au> wrote:
>
> PS.  I'll squeeze these into this merge window, since they're trivial.

s/'re trivial/fix bugs/  ;-)
diff mbox

Patch

diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index ca3ad41..b300787 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -1,6 +1,7 @@ 
 #ifndef _LINUX_VIRTIO_RING_H
 #define _LINUX_VIRTIO_RING_H
 
+#include <asm/barrier.h>
 #include <linux/irqreturn.h>
 #include <uapi/linux/virtio_ring.h>