Re: [net-next PATCH v6 4/6] net: phy: introduce phy_find_by_mdio_handle()

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

 



On Mon, Jul 13, 2020 at 9:04 AM Calvin Johnson
<calvin.johnson@xxxxxxxxxxx> wrote:
> On Sat, Jul 11, 2020 at 02:41:12PM -0700, Florian Fainelli wrote:
> > On 7/10/2020 11:55 PM, Calvin Johnson wrote:

...

> > > +   err = fwnode_property_read_u32(fwnode, "phy-channel", &addr);
> > > +   if (err)
> > > +           return ERR_PTR(err);
> > > +   if (addr < 0 || addr >= PHY_MAX_ADDR)
> >
> > Can an u32 ever be < 0?
>
> Will remove it.

Since it's harmless and we have a fix to shut the compiler up on this
kind of checks and Linus actually in favour of _seeing_ range checks
explicitly I think no need to drop, but it's up to you.


-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux