WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: Signed bit field; int have_hotplug_status_watch:1

To: "Dr. David Alan Gilbert" <linux@xxxxxxxxxxx>
Subject: [Xen-devel] Re: Signed bit field; int have_hotplug_status_watch:1
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Mon, 4 Apr 2011 09:26:24 +0100
Cc: netdev@xxxxxxxxxxxxxxx, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "konrad.wilk@xxxxxxxxxx" <konrad.wilk@xxxxxxxxxx>, "virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx" <virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 04 Apr 2011 01:28:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110403213241.GA25913@gallifrey>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <20110403213241.GA25913@gallifrey>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Sun, 2011-04-03 at 22:32 +0100, Dr. David Alan Gilbert wrote:
> Hi Ian,
>    I've been going through some sparse scans of the kernel and
> it threw up:
> 
>   CHECK   drivers/net/xen-netback/xenbus.c
> drivers/net/xen-netback/xenbus.c:29:40: error: dubious one-bit signed bitfield
> 
>         int have_hotplug_status_watch:1;
> 
> from your patch f942dc2552b8bfdee607be867b12a8971bb9cd85 
> 
> It does look like that should be an unsigned (given it's assigned
> 0 and 1)

I agree.

8<----------------------------------

>From 38fdb7199a0c3c5eb18ec27d2380e21116c97e29 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Mon, 4 Apr 2011 09:18:35 +0100
Subject: [PATCH] xen: netback: use unsigned type for one-bit bitfield.

Fixes error from sparse:
  CHECK   drivers/net/xen-netback/xenbus.c
drivers/net/xen-netback/xenbus.c:29:40: error: dubious one-bit signed bitfield

        int have_hotplug_status_watch:1;

Reported-by: Dr. David Alan Gilbert <linux@xxxxxxxxxxx>
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: netdev@xxxxxxxxxxxxxxx
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
---
 drivers/net/xen-netback/xenbus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 22b8c35..1ce729d 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -26,7 +26,7 @@ struct backend_info {
        struct xenvif *vif;
        enum xenbus_state frontend_state;
        struct xenbus_watch hotplug_status_watch;
-       int have_hotplug_status_watch:1;
+       u8 have_hotplug_status_watch:1;
 };
 
 static int connect_rings(struct backend_info *);
-- 
1.7.2.5



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>