Re: [PATCH v4.3] net: phy: Add driver for Motorcomm yt8521 gigabit ethernet phy

From: Jakub Kicinski
Date: Tue Aug 16 2022 - 23:05:05 EST


On Tue, 16 Aug 2022 19:17:03 +0800 Frank wrote:
> Add a driver for the motorcomm yt8521 gigabit ethernet phy. We have verified
> the driver on StarFive VisionFive development board, which is developed by
> Shanghai StarFive Technology Co., Ltd.. On the board, yt8521 gigabit ethernet
> phy works in utp mode, RGMII interface, supports 1000M/100M/10M speeds, and
> wol(magic package).

Clang reports:

drivers/net/phy/motorcomm.c:1121:6: warning: variable 'changed' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (err > 0)
^~~~~~~
drivers/net/phy/motorcomm.c:1124:47: note: uninitialized use occurs here
return genphy_check_and_restart_aneg(phydev, changed);
^~~~~~~
drivers/net/phy/motorcomm.c:1121:2: note: remove the 'if' if its condition is always true
if (err > 0)
^~~~~~~~~~~~
drivers/net/phy/motorcomm.c:1095:18: note: initialize the variable 'changed' to silence this warning
int err, changed;
^
= 0