Re: linux-4.14-rc3/drivers/net/ieee802154/atusb.c:827: pointless test ?

From: Stefan Schmidt
Date: Thu Oct 19 2017 - 09:30:54 EST


Hello.

[Sorry for the delay, not really at my machine the last few weeks]

On 10/06/2017 09:06 PM, David Binderman wrote:
> Hello there,
>
> linux-4.14-rc3/drivers/net/ieee802154/atusb.c:827]: (style) Unsigned variable 'fw_ver_maj' can't be negative so it is unnecessary to test it.
>
> Source code is
>
> if (atusb->fw_ver_maj >= 0 && atusb->fw_ver_min >= 3)
>
> but
>
> unsigned char fw_ver_maj; /* Firmware major version number */
>
> Suggest remove pointless test.

Thanks for pointing this out. Geert pointed the compiler warnign out a while ago and I actually did a fix that works for it already.

https://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next.git/commit/?id=763556980dde78166886734ae470664c67067dd4

Its waiting for getting pulled into net-next right now.

regards
Stefan Schmidt