[xlnx:xlnx_rebase_v5.4 1563/1765] drivers/net/ethernet/xilinx/xilinx_axienet_main.c:1962:10: warning: 'regval' may be used uninitialized in this function
From: kernel test robot <hidden>
Date: 2021-07-22 13:39:29
Also in:
oe-kbuild-all
Hi Harini, FYI, the error/warning still remains. tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.4 head: 2f686fa6c0bf7fa168dc45dd7ce1359217212911 commit: d42de16ed2832785de4066fac3883d46ed3f063f [1563/1765] net: xilinx: XXV Ethernet HW timestamp fixes config: s390-randconfig-s031-20210722 (attached as .config) compiler: s390-linux-gcc (GCC) 10.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.3-341-g8af24329-dirty # https://github.com/Xilinx/linux-xlnx/commit/d42de16ed2832785de4066fac3883d46ed3f063f git remote add xlnx https://github.com/Xilinx/linux-xlnx git fetch --no-tags xlnx xlnx_rebase_v5.4 git checkout d42de16ed2832785de4066fac3883d46ed3f063f # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=s390 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <redacted> Note: it may well be a FALSE warning. FWIW you are at least aware of it now. http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings All warnings (new ones prefixed by >>): drivers/net/ethernet/xilinx/xilinx_axienet_main.c: In function 'axienet_queue_xmit': drivers/net/ethernet/xilinx/xilinx_axienet_main.c:1077:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 1077 | const struct ethhdr *eth; | ^~~~~ drivers/net/ethernet/xilinx/xilinx_axienet_main.c: In function 'axienet_set_ts_config':
quoted
drivers/net/ethernet/xilinx/xilinx_axienet_main.c:1962:10: warning: 'regval' may be used uninitialized in this function [-Wmaybe-uninitialized]
1962 | regval &= ~XAE_TC_INBAND1588_MASK;
drivers/net/ethernet/xilinx/xilinx_axienet_main.c:1927:6: note: 'regval' was declared here
1927 | u32 regval;
| ^~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for PTP_1588_CLOCK
Depends on NET && POSIX_TIMERS
Selected by
- XILINX_TSN_PTP && NETDEVICES && ETHERNET && NET_VENDOR_XILINX && XILINX_TSN
Selected by
- XILINX_AXI_EMAC_HWTSTAMP && NETDEVICES && ETHERNET && NET_VENDOR_XILINX && XILINX_AXI_EMAC
vim +/regval +1962 drivers/net/ethernet/xilinx/xilinx_axienet_main.c
bbcf6f9bb1bc2063 Saurabh Sengar 2020-02-13 1951
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1952 /* reserved for future extensions */
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1953 if (config->flags)
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1954 return -EINVAL;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1955
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1956 /* Read the current value in the MAC TX CTRL register */
d42de16ed2832785 Harini Katakam 2020-09-24 1957 if (lp->axienet_config->mactype != XAXIENET_10G_25G)
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1958 regval = axienet_ior(lp, XAE_TC_OFFSET);
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1959
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1960 switch (config->tx_type) {
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1961 case HWTSTAMP_TX_OFF:
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 @1962 regval &= ~XAE_TC_INBAND1588_MASK;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1963 break;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1964 case HWTSTAMP_TX_ON:
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1965 config->tx_type = HWTSTAMP_TX_ON;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1966 regval |= XAE_TC_INBAND1588_MASK;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1967 break;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1968 case HWTSTAMP_TX_ONESTEP_SYNC:
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1969 config->tx_type = HWTSTAMP_TX_ONESTEP_SYNC;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1970 regval |= XAE_TC_INBAND1588_MASK;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1971 break;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1972 default:
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1973 return -ERANGE;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1974 }
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1975
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1976 if (lp->axienet_config->mactype != XAXIENET_10G_25G)
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1977 axienet_iow(lp, XAE_TC_OFFSET, regval);
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1978
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1979 /* Read the current value in the MAC RX RCW1 register */
d42de16ed2832785 Harini Katakam 2020-09-24 1980 if (lp->axienet_config->mactype != XAXIENET_10G_25G)
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1981 regval = axienet_ior(lp, XAE_RCW1_OFFSET);
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1982
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1983 /* On RX always timestamp everything */
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1984 switch (config->rx_filter) {
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1985 case HWTSTAMP_FILTER_NONE:
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1986 regval &= ~XAE_RCW1_INBAND1588_MASK;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1987 break;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1988 default:
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1989 config->rx_filter = HWTSTAMP_FILTER_ALL;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1990 regval |= XAE_RCW1_INBAND1588_MASK;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1991 }
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1992
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1993 if (lp->axienet_config->mactype != XAXIENET_10G_25G)
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1994 axienet_iow(lp, XAE_RCW1_OFFSET, regval);
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1995
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1996 return 0;
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1997 }
7aee9da192ba5721 Appana Durga Kedareswara Rao 2020-01-24 1998
:::::: The code at line 1962 was first introduced by commit
:::::: 7aee9da192ba57210897a418ada793ac5b15a851 net: axienet: Add support for 1588
:::::: TO: Appana Durga Kedareswara Rao [off-list ref]
:::::: CC: Michal Simek [off-list ref]
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Attachments
- .config.gz [application/gzip] 18524 bytes
- (unnamed) [text/plain] 176 bytes · preview