Skip to contentSkip to conversation

gspca: dubious one-bit signed bitfield

PATCH In review Emil Goode 2 participants 3 messages Aug 5, 2012 – Aug 9, 2012

Subsystems (2)
lore
Share & tools
lore

Emil Goode

author
#0 lore raw

PATCH 1/1 gspca: dubious one-bit signed bitfield

This patch changes some signed integers to unsigned because they are not intended for negative values and sparse is making noise about it.

Sparse gives eight of these errors:
drivers/media/video/gspca/ov519.c:144:29: error: dubious one-bit signed bitfield

---
 drivers/media/video/gspca/ov519.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/media/video/gspca/ov519.c +8 -8
index bfc7cef..c1a21bf 100644
@@ -141,14 +141,14 @@ enum sensors {
 
 /* table of the disabled controls */
 struct ctrl_valid {
-	int has_brightness:1;
-	int has_contrast:1;
-	int has_exposure:1;
-	int has_autogain:1;
-	int has_sat:1;
-	int has_hvflip:1;
-	int has_autobright:1;
-	int has_freq:1;
+	unsigned int has_brightness:1;
+	unsigned int has_contrast:1;
+	unsigned int has_exposure:1;
+	unsigned int has_autogain:1;
+	unsigned int has_sat:1;
+	unsigned int has_hvflip:1;
+	unsigned int has_autobright:1;
+	unsigned int has_freq:1;
 };
 
 static const struct ctrl_valid valid_controls[] = {
Signature · 1 line
1.7.10.4
#1 lore raw

Hi,

Quoted 8 lines · Emil Goode

This patch changes some signed integers to unsigned because they are not intended for negative values and sparse is making noise about it.

Sparse gives eight of these errors:
drivers/media/video/gspca/ov519.c:144:29: error: dubious one-bit signed bitfield

Thanks, I'll add this to my gspca tree.

Regards,

Hans

#2 lore raw
In reply to Emil Goode

Hi,

Thanks for the patch, I've added it to my tree for 3.7:
http://git.linuxtv.org/hgoede/gspca.git/shortlog/refs/heads/media-for_v3.7-wip

Regards,

Hans

Quoted 40 lines · Emil Goode

This patch changes some signed integers to unsigned because they are not intended for negative values and sparse is making noise about it.

Sparse gives eight of these errors:
drivers/media/video/gspca/ov519.c:144:29: error: dubious one-bit signed bitfield

---
  drivers/media/video/gspca/ov519.c |   16 ++++++++--------
  1 file changed, 8 insertions(+), 8 deletions(-)
drivers/media/video/gspca/ov519.c +8 -8
index bfc7cef..c1a21bf 100644
@@ -141,14 +141,14 @@ enum sensors {
 
  /* table of the disabled controls */
  struct ctrl_valid {
-	int has_brightness:1;
-	int has_contrast:1;
-	int has_exposure:1;
-	int has_autogain:1;
-	int has_sat:1;
-	int has_hvflip:1;
-	int has_autobright:1;
-	int has_freq:1;
+	unsigned int has_brightness:1;
+	unsigned int has_contrast:1;
+	unsigned int has_exposure:1;
+	unsigned int has_autogain:1;
+	unsigned int has_sat:1;
+	unsigned int has_hvflip:1;
+	unsigned int has_autobright:1;
+	unsigned int has_freq:1;
  };
 
  static const struct ctrl_valid valid_controls[] = {