On Fri, 26 May 2023 14:45:54 +0300 Dan Carpenter wrote: > The "val" variable is used to store error codes from phy_read() so > it needs to be signed for the error handling to work as expected. > > Fixes: 014068dcb5b1 ("net: phy: genphy_loopback: add link speed configuration") > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Is it going to be obvious to PHY-savvy folks that the val passed to phy_read_poll_timeout() must be an int? Is it a very common pattern? My outsider intuition is that since regs are 16b, u16 is reasonable, and more people may make the same mistake. Therefore we should try to fix phy_read_poll_timeout() instead to use a local variable like it does for __ret. Weaker version would be to add a compile time check to ensure val is signed (assert(typeof(val)~0ULL < 0) or such?). Opinions?