Signed bit field; int have_hotplug_status_watch:1
Subsystems (4)
Hi Ian,
I've been going through some sparse scans of the kernel and
it threw up:
CHECK drivers/net/xen-netback/xenbus.cdrivers/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)
Dave
Signature · 4 lines
-----Open up your eyes, open up your mind, open up your code ------- / Dr. David Alan Gilbert | Running GNU/Linux | Happy \ \ gro.gilbert @ treblig.org | | In Hex / \ _________________________|_____ http://www.treblig.org |_______/
Quoted 7 lines · Dr. David Alan Gilbert
Hi Ian,
I've been going through some sparse scans of the kernel and
it threw up:CHECK
drivers/net/xen-netback/xenbus.cdrivers/net/xen-netback/xenbus.c:29:40: error: dubious one-bit signed bitfield
Quoted 6 lines
int have_hotplug_status_watch:1;from your patch
f942dc2552b8bfdee607be867b12a8971bb9cd85It does look like that should be an unsigned (given it's assigned 0 and 1)
I agree.
8<----------------------------------
Quoted 1 line
From
38fdb7199a0c3c5eb18ec27d2380e21116c97e29Mon Sep 17 00:00:00 2001
From: Ian Campbell <[email protected]>
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.cdrivers/net/xen-netback/xenbus.c:29:40: error: dubious one-bit signed bitfield
int have_hotplug_status_watch:1;
--- drivers/net/xen-netback/xenbus.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/xen-netback/xenbus.c +1 -1
@@ -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 *);
Signature · 1 line
1.7.2.5
From: Ian Campbell <[email protected]>
Date: Mon, 4 Apr 2011 09:26:24 +0100
Quoted 10 lines
Subject: [PATCH] xen: netback: use unsigned type for one-bit bitfield.
Fixes error from sparse:
CHECKdrivers/net/xen-netback/xenbus.cdrivers/net/xen-netback/xenbus.c:29:40: error: dubious one-bit signed bitfieldint have_hotplug_status_watch:1;Reported-by Dr. David Alan Gilbert <[email protected]>Signed-off-by Ian Campbell <[email protected]>
Applied to net-next-2.6, thanks.
From: Ian Campbell <[email protected]>
Date: Mon, 4 Apr 2011 09:26:24 +0100
Quoted 10 lines
Subject: [PATCH] xen: netback: use unsigned type for one-bit bitfield.
Fixes error from sparse:
CHECKdrivers/net/xen-netback/xenbus.cdrivers/net/xen-netback/xenbus.c:29:40: error: dubious one-bit signed bitfieldint have_hotplug_status_watch:1;Reported-by Dr. David Alan Gilbert <[email protected]>Signed-off-by Ian Campbell <[email protected]>
Applied to net-next-2.6, thanks.
Quoted 7 lines · Dr. David Alan Gilbert
Hi Ian,
I've been going through some sparse scans of the kernel and
it threw up:CHECK
drivers/net/xen-netback/xenbus.cdrivers/net/xen-netback/xenbus.c:29:40: error: dubious one-bit signed bitfield
Quoted 6 lines
int have_hotplug_status_watch:1;from your patch
f942dc2552b8bfdee607be867b12a8971bb9cd85It 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 <[email protected]>
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.cdrivers/net/xen-netback/xenbus.c:29:40: error: dubious one-bit signed bitfield
int have_hotplug_status_watch:1;
--- drivers/net/xen-netback/xenbus.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/xen-netback/xenbus.c +1 -1
@@ -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 *);
Signature · 1 line
1.7.2.5