Re: [PATCH net] net: axienet: fix a signedness bug in probe

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

 



Hi, Dan

On Wed, Sep 25, 2019 at 01:59:11PM +0300, Dan Carpenter wrote:
> The "lp->phy_mode" is an enum but in this context GCC treats it as an
> unsigned int so the error handling is never triggered.
> 
>  		lp->phy_mode = of_get_phy_mode(pdev->dev.of_node);
> -		if (lp->phy_mode < 0) {
> +		if ((int)lp->phy_mode < 0) {

This (almost) exact code appears in a lot of different drivers too,
so maybe it'd be nice to review them all and apply the same cast if needed?

Best regards

-- 
Alvaro G. M.



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux