Re: [PATCH 5/9] [media] dib9000: read16/write16 could return an error code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 22, 2016 at 2:09 PM, Mauro Carvalho Chehab
<mchehab@xxxxxxxxxxxxxxx> wrote:
> Both dib9000_read16_attr and dib9000_write16_attr can return an
> error code. However, they currently return an u16. This produces the
> following warnings on smatch:
>
>         drivers/media/dvb-frontends/dib9000.c:262 dib9000_read16_attr() warn: signedness bug returning '(-121)'
>         drivers/media/dvb-frontends/dib9000.c:321 dib9000_write16_attr() warn: signedness bug returning '(-22)'
>         drivers/media/dvb-frontends/dib9000.c:353 dib9000_write16_attr() warn: signedness bug returning '(-121)'
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxx>
> ---
>  drivers/media/dvb-frontends/dib9000.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

While reviewing this, I was originally concerned with
"dib9000_read16_attr" but after tracing through the functions, I see
that the change looks OK.

For the function, "dib9000_write16_attr",  we will only ever return
-EINVAL, 0, or possibly the return value of i2c_transfer.  It is OK to
convert the function to return 'int' here instead of 'u16'.

This change looks reasonable as well.

Reviewed-by: Michael Ira Krufky <mkrufky@xxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux