[net-next PATCH v3 3/3] net: phy: Add Airoha AN8855 Internal Switch Gigabit PHY
kernel test robot
lkp at intel.com
Wed Nov 6 18:37:32 PST 2024
Hi Christian,
kernel test robot noticed the following build warnings:
[auto build test WARNING on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Christian-Marangi/dt-bindings-net-dsa-Add-Airoha-AN8855-Gigabit-Switch-documentation/20241106-203624
base: net-next/main
patch link: https://lore.kernel.org/r/20241106122254.13228-4-ansuelsmth%40gmail.com
patch subject: [net-next PATCH v3 3/3] net: phy: Add Airoha AN8855 Internal Switch Gigabit PHY
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20241107/202411071000.uL10bu3r-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241107/202411071000.uL10bu3r-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411071000.uL10bu3r-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/net/phy/air_an8855.c:6:
In file included from include/linux/phy.h:16:
In file included from include/linux/ethtool.h:18:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:8:
In file included from include/linux/cacheflush.h:5:
In file included from arch/x86/include/asm/cacheflush.h:5:
In file included from include/linux/mm.h:2213:
include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
505 | item];
| ~~~~
include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
512 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
525 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/phy/air_an8855.c:137:6: warning: variable 'val' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
137 | if (saved_page >= 0)
| ^~~~~~~~~~~~~~~
drivers/net/phy/air_an8855.c:139:45: note: uninitialized use occurs here
139 | ret = phy_restore_page(phydev, saved_page, val);
| ^~~
drivers/net/phy/air_an8855.c:137:2: note: remove the 'if' if its condition is always true
137 | if (saved_page >= 0)
| ^~~~~~~~~~~~~~~~~~~~
138 | val = __phy_read(phydev, AN8855_PHY_EXT_REG_14);
drivers/net/phy/air_an8855.c:133:9: note: initialize the variable 'val' to silence this warning
133 | int val;
| ^
| = 0
>> drivers/net/phy/air_an8855.c:155:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
155 | if (saved_page >= 0) {
| ^~~~~~~~~~~~~~~
drivers/net/phy/air_an8855.c:164:46: note: uninitialized use occurs here
164 | return phy_restore_page(phydev, saved_page, ret);
| ^~~
drivers/net/phy/air_an8855.c:155:2: note: remove the 'if' if its condition is always true
155 | if (saved_page >= 0) {
| ^~~~~~~~~~~~~~~~~~~~
drivers/net/phy/air_an8855.c:152:9: note: initialize the variable 'ret' to silence this warning
152 | int ret;
| ^
| = 0
6 warnings generated.
vim +137 drivers/net/phy/air_an8855.c
129
130 static int an8855_get_downshift(struct phy_device *phydev, u8 *data)
131 {
132 int saved_page;
133 int val;
134 int ret;
135
136 saved_page = phy_select_page(phydev, AN8855_PHY_PAGE_EXTENDED_1);
> 137 if (saved_page >= 0)
138 val = __phy_read(phydev, AN8855_PHY_EXT_REG_14);
139 ret = phy_restore_page(phydev, saved_page, val);
140 if (ret)
141 return ret;
142
143 *data = val & AN8855_PHY_EXT_REG_14 ? DOWNSHIFT_DEV_DEFAULT_COUNT :
144 DOWNSHIFT_DEV_DISABLE;
145
146 return 0;
147 }
148
149 static int an8855_set_downshift(struct phy_device *phydev, u8 cnt)
150 {
151 int saved_page;
152 int ret;
153
154 saved_page = phy_select_page(phydev, AN8855_PHY_PAGE_EXTENDED_1);
> 155 if (saved_page >= 0) {
156 if (cnt != DOWNSHIFT_DEV_DISABLE)
157 ret = __phy_set_bits(phydev, AN8855_PHY_EXT_REG_14,
158 AN8855_PHY_EN_DOWN_SHFIT);
159 else
160 ret = __phy_clear_bits(phydev, AN8855_PHY_EXT_REG_14,
161 AN8855_PHY_EN_DOWN_SHFIT);
162 }
163
164 return phy_restore_page(phydev, saved_page, ret);
165 }
166
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
More information about the Linux-mediatek
mailing list