Hi Bartosz,
I love your patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v5.8-rc2]
[cannot apply to arm/for-next next-20200622]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Bartosz-Golaszewski/net-phy-corr...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (
https://github.com/llvm/llvm-project
1d4c87335d5236ea1f35937e1014980ba961ae34)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
> drivers/of/of_mdio.c:123:6: warning: variable 'phy_id' is
used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (!is_c45) {
^~~~~~~
drivers/of/of_mdio.c:129:38: note: uninitialized use occurs here
phy = phy_device_create(mdio, addr, phy_id, is_c45);
^~~~~~
drivers/of/of_mdio.c:123:2: note: remove the 'if' if its condition is always true
if (!is_c45) {
^~~~~~~~~~~~~
drivers/of/of_mdio.c:114:12: note: initialize the variable 'phy_id' to silence
this warning
u32 phy_id;
^
= 0
1 warning generated.
vim +123 drivers/of/of_mdio.c
106
107 static int of_mdiobus_register_phy(struct mii_bus *mdio,
108 struct device_node *child, u32 addr)
109 {
110 struct mii_timestamper *mii_ts;
111 struct phy_device *phy;
112 bool is_c45;
113 int rc;
114 u32 phy_id;
115
116 mii_ts = of_find_mii_timestamper(child);
117 if (IS_ERR(mii_ts))
118 return PTR_ERR(mii_ts);
119
120 is_c45 = of_device_is_compatible(child,
121 "ethernet-phy-ieee802.3-c45");
122
123 if (!is_c45) {
124 rc = of_get_phy_id(child,
&phy_id);
125 if (rc)
126 phy_id = PHY_ID_NONE;
127 }
128
129 phy = phy_device_create(mdio, addr, phy_id, is_c45);
130 if (IS_ERR(phy)) {
131 if (mii_ts)
132 unregister_mii_timestamper(mii_ts);
133 return PTR_ERR(phy);
134 }
135
136 rc = of_mdiobus_phy_device_register(mdio, phy, child, addr);
137 if (rc) {
138 if (mii_ts)
139 unregister_mii_timestamper(mii_ts);
140 phy_device_free(phy);
141 return rc;
142 }
143
144 /* phy->mii_ts may already be defined by the PHY driver. A
145 * mii_timestamper probed via the device tree will still have
146 * precedence.
147 */
148 if (mii_ts)
149 phy->mii_ts = mii_ts;
150
151 return 0;
152 }
153
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org