Re: [PATCH net-next] net: micrel: Fix set/get PHC time for lan8814

From: Andrew Lunn
Date: Fri Jan 26 2024 - 08:16:11 EST


> > + *sec |= lanphy_read_page_reg(phydev, 4, PTP_CLOCK_READ_SEC_MID);
>
> lanphy_read_page_reg returns int, but only 16 bits have meanings here.
> Is it safe to assume that other 16 bits will be zeros always?

Yes. __phy_read() should only return a negative error code, or a value
which fits in a u16. If any of the top bits are set, its a bug in the
MDIO driver which needs finding and fixing.

Andrew