Re: drivers/staging/media/ipu3/ipu3-css.c:1831: bad compare ?

2019-01-07 Thread sakari.ai...@linux.intel.com
Hi David,

On Mon, Jan 07, 2019 at 10:30:55PM +, David Binderman wrote:
> Hello there,
> 
> drivers/staging/media/ipu3/ipu3-css.c:1831:30: warning: comparison of 
> unsigned expression < 0 is always false [-Wtype-limits]
> 
> Source code is
> css->pipes[pipe].bindex =
> ipu3_css_find_binary(css, pipe, q, r);
> if (css->pipes[pipe].bindex < 0) {
> dev_err(css->dev, "failed to find suitable binary\n");
> return -EINVAL;
> }
> 
> Suggest sanity check return value from function first, then if it is ok,
> assign it to an unsigned variable.

Thanks for reporting this. There have been a few patches to address it so
far, the one going in is here:

https://patchwork.linuxtv.org/patch/53633/>

-- 
Sakari Ailus
sakari.ai...@linux.intel.com
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


drivers/staging/media/ipu3/ipu3-css.c:1831: bad compare ?

2019-01-07 Thread David Binderman
Hello there,

drivers/staging/media/ipu3/ipu3-css.c:1831:30: warning: comparison of unsigned 
expression < 0 is always false [-Wtype-limits]

Source code is
css->pipes[pipe].bindex =
ipu3_css_find_binary(css, pipe, q, r);
if (css->pipes[pipe].bindex < 0) {
dev_err(css->dev, "failed to find suitable binary\n");
return -EINVAL;
}

Suggest sanity check return value from function first, then if it is ok,
assign it to an unsigned variable.

Regards

David Binderman



___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel