* [patch] [media] go7007: dubious one-bit signed bitfields
@ 2013-04-17 7:20 Dan Carpenter
2013-04-17 7:49 ` Hans Verkuil
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-04-17 7:20 UTC (permalink / raw)
To: Hans Verkuil; +Cc: Mauro Carvalho Chehab, linux-media, kernel-janitors
Because they're signed, "is_video" and "is_audio" can be 0 and -1
instead of 0 and 1 as intended. It doesn't cause a bug, but it makes
Sparse complain:
drivers/staging/media/go7007/go7007-priv.h:94:31: error: dubious one-bit signed bitfield
drivers/staging/media/go7007/go7007-priv.h:95:31: error: dubious one-bit signed bitfield
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/staging/media/go7007/go7007-priv.h b/drivers/staging/media/go7007/go7007-priv.h
index 8bde187..6e16af7 100644
--- a/drivers/staging/media/go7007/go7007-priv.h
+++ b/drivers/staging/media/go7007/go7007-priv.h
@@ -91,8 +91,8 @@ struct go7007_board_info {
int num_i2c_devs;
struct go_i2c {
const char *type;
- int is_video:1;
- int is_audio:1;
+ unsigned int is_video:1;
+ unsigned int is_audio:1;
int addr;
u32 flags;
} i2c_devs[5];
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] [media] go7007: dubious one-bit signed bitfields
2013-04-17 7:20 [patch] [media] go7007: dubious one-bit signed bitfields Dan Carpenter
@ 2013-04-17 7:49 ` Hans Verkuil
0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2013-04-17 7:49 UTC (permalink / raw)
To: Dan Carpenter
Cc: Hans Verkuil, Mauro Carvalho Chehab, linux-media, kernel-janitors
On Wed 17 April 2013 09:20:30 Dan Carpenter wrote:
> Because they're signed, "is_video" and "is_audio" can be 0 and -1
> instead of 0 and 1 as intended. It doesn't cause a bug, but it makes
> Sparse complain:
> drivers/staging/media/go7007/go7007-priv.h:94:31: error: dubious one-bit signed bitfield
> drivers/staging/media/go7007/go7007-priv.h:95:31: error: dubious one-bit signed bitfield
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Thanks!
Hans
>
> diff --git a/drivers/staging/media/go7007/go7007-priv.h b/drivers/staging/media/go7007/go7007-priv.h
> index 8bde187..6e16af7 100644
> --- a/drivers/staging/media/go7007/go7007-priv.h
> +++ b/drivers/staging/media/go7007/go7007-priv.h
> @@ -91,8 +91,8 @@ struct go7007_board_info {
> int num_i2c_devs;
> struct go_i2c {
> const char *type;
> - int is_video:1;
> - int is_audio:1;
> + unsigned int is_video:1;
> + unsigned int is_audio:1;
> int addr;
> u32 flags;
> } i2c_devs[5];
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-17 7:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-17 7:20 [patch] [media] go7007: dubious one-bit signed bitfields Dan Carpenter
2013-04-17 7:49 ` Hans Verkuil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox