diff mbox

[media] fix a warning on avr32 arch

Message ID 3948e2c09f98e556afe11f0e3d348bbe610af31e.1414664215.git.mchehab@osg.samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab Oct. 30, 2014, 10:16 a.m. UTC
on avr32 arch, those warnings happen:
	drivers/media/firewire/firedtv-fw.c: In function 'node_update':
	drivers/media/firewire/firedtv-fw.c:329: warning: comparison is always true due to limited range of data type

In this particular case, the signal is desired, as the isochannel
var can be initalized with -1 inside the driver.

So, change the type to s8, to avoid issues on archs where char
is unsigned.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

Comments

Stefan Richter Oct. 30, 2014, 1:15 p.m. UTC | #1
On Oct 30 Mauro Carvalho Chehab wrote:
> on avr32 arch, those warnings happen:
> 	drivers/media/firewire/firedtv-fw.c: In function 'node_update':
> 	drivers/media/firewire/firedtv-fw.c:329: warning: comparison is always true due to limited range of data type
> 
> In this particular case, the signal is desired, as the isochannel
> var can be initalized with -1 inside the driver.
> 
> So, change the type to s8, to avoid issues on archs where char
> is unsigned.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

Reviewed-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

> 
> diff --git a/drivers/media/firewire/firedtv.h b/drivers/media/firewire/firedtv.h
> index c2ba085e0d20..346a85be6de2 100644
> --- a/drivers/media/firewire/firedtv.h
> +++ b/drivers/media/firewire/firedtv.h
> @@ -96,7 +96,7 @@ struct firedtv {
>  
>  	enum model_type		type;
>  	char			subunit;
> -	char			isochannel;
> +	s8			isochannel;
>  	struct fdtv_ir_context	*ir_context;
>  
>  	fe_sec_voltage_t	voltage;
diff mbox

Patch

diff --git a/drivers/media/firewire/firedtv.h b/drivers/media/firewire/firedtv.h
index c2ba085e0d20..346a85be6de2 100644
--- a/drivers/media/firewire/firedtv.h
+++ b/drivers/media/firewire/firedtv.h
@@ -96,7 +96,7 @@  struct firedtv {
 
 	enum model_type		type;
 	char			subunit;
-	char			isochannel;
+	s8			isochannel;
 	struct fdtv_ir_context	*ir_context;
 
 	fe_sec_voltage_t	voltage;