Use existing config check when including eventfd.h

Submitted by Mike McCormack on July 21, 2010, 11:45 p.m.

Details

Message ID 4C4786A4.5000100@ring3k.org
State New
Headers show

Commit Message

Mike McCormack July 21, 2010, 11:45 p.m.
Signed-off-by: Mike McCormack <mikem@ring3k.org>
---
 hw/vhost.c     |    2 ++
 hw/vhost_net.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

Comments

Stefan Hajnoczi July 22, 2010, 8:11 a.m.
On Thu, Jul 22, 2010 at 12:45 AM, Mike McCormack <mikem@ring3k.org> wrote:
> Signed-off-by: Mike McCormack <mikem@ring3k.org>
> ---
>  hw/vhost.c     |    2 ++
>  hw/vhost_net.c |    2 ++
>  2 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/hw/vhost.c b/hw/vhost.c
> index d37a66e..e1cd4d2 100644
> --- a/hw/vhost.c
> +++ b/hw/vhost.c
> @@ -11,7 +11,9 @@
>  */
>
>  #include <sys/ioctl.h>
> +#ifdef CONFIG_EVENTFD
>  #include <sys/eventfd.h>
> +#endif
>  #include "vhost.h"
>  #include "hw/hw.h"
>  /* For range_get_last */
> diff --git a/hw/vhost_net.c b/hw/vhost_net.c
> index 606aa0c..f4bddd4 100644
> --- a/hw/vhost_net.c
> +++ b/hw/vhost_net.c
> @@ -20,7 +20,9 @@
>
>  #ifdef CONFIG_VHOST_NET
>  #include <linux/vhost.h>
> +#ifdef CONFIG_EVENTFD
>  #include <sys/eventfd.h>
> +#endif
>  #include <sys/socket.h>
>  #include <linux/kvm.h>
>  #include <fcntl.h>
> --

vhost.c and vhost_net.c do not use sys/eventfd.h, please remove the
#include instead of #ifdefing it.  The only source file that needs to
include it is event_notifier.c from what I can tell.

Stefan

> 1.5.6.5
>
>
>

Patch hide | download patch | download mbox

diff --git a/hw/vhost.c b/hw/vhost.c
index d37a66e..e1cd4d2 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -11,7 +11,9 @@ 
  */
 
 #include <sys/ioctl.h>
+#ifdef CONFIG_EVENTFD
 #include <sys/eventfd.h>
+#endif
 #include "vhost.h"
 #include "hw/hw.h"
 /* For range_get_last */
diff --git a/hw/vhost_net.c b/hw/vhost_net.c
index 606aa0c..f4bddd4 100644
--- a/hw/vhost_net.c
+++ b/hw/vhost_net.c
@@ -20,7 +20,9 @@ 
 
 #ifdef CONFIG_VHOST_NET
 #include <linux/vhost.h>
+#ifdef CONFIG_EVENTFD
 #include <sys/eventfd.h>
+#endif
 #include <sys/socket.h>
 #include <linux/kvm.h>
 #include <fcntl.h>