Skip to contentSkip to conversation

markers: fix sparse warnings in markers.c

PATCH In review Harvey Harrison 2 participants 2 messages Feb 21, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 markers: fix sparse warnings in markers.c

char can be unsigned
kernel/marker.c:64:20: error: dubious one-bit signed bitfield kernel/marker.c:65:14: error: dubious one-bit signed bitfield

---
Introduced between -rc1 and -rc2

 kernel/marker.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/marker.c +2 -2
index c4c2cd8..50effc0 100644
@@ -61,8 +61,8 @@ struct marker_entry {
 	int refcount;	/* Number of times armed. 0 if disarmed. */
 	struct rcu_head rcu;
 	void *oldptr;
-	char rcu_pending:1;
-	char ptype:1;
+	unsigned char rcu_pending:1;
+	unsigned char ptype:1;
 	char name[0];	/* Contains name'\0'format'\0' */
 };
 
Signature · 1 line
1.5.4.2.200.g99e75
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · * Harvey Harrison ([email protected]) wrote:

char can be unsigned
kernel/marker.c:64:20: error: dubious one-bit signed bitfield kernel/marker.c:65:14: error: dubious one-bit signed bitfield

Yep, it makes sense.

Thanks!

Quoted 25 lines

---
Introduced between -rc1 and -rc2

 kernel/marker.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/marker.c +2 -2
index c4c2cd8..50effc0 100644
@@ -61,8 +61,8 @@ struct marker_entry {
 	int refcount;	/* Number of times armed. 0 if disarmed. */
 	struct rcu_head rcu;
 	void *oldptr;
-	char rcu_pending:1;
-	char ptype:1;
+	unsigned char rcu_pending:1;
+	unsigned char ptype:1;
 	char name[0];	/* Contains name'\0'format'\0' */
 };
 
Signature · 1 line
1.5.4.2.200.g99e75
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68