[xlnx:master 39/98] 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: 2020-09-26 17:58:51
Also in:
oe-kbuild-all
tree: https://github.com/Xilinx/linux-xlnx master head: 664f8a639f658d0964f7cbd030aa95f42d6c4567 commit: b83c55d11cbd986418edbf4b407ab0c8bbe2efb8 [39/98] net: xilinx: XXV Ethernet HW timestamp fixes config: riscv-allyesconfig (attached as .config) compiler: riscv64-linux-gcc (GCC) 9.3.0 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 # https://github.com/Xilinx/linux-xlnx/commit/b83c55d11cbd986418edbf4b407ab0c8bbe2efb8 git remote add xlnx https://github.com/Xilinx/linux-xlnx git fetch --no-tags xlnx master git checkout b83c55d11cbd986418edbf4b407ab0c8bbe2efb8 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv 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_ioctl':
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;
| ^~~~~~
vim +/regval +1962 drivers/net/ethernet/xilinx/xilinx_axienet_main.c
bff352467d6de71 Saurabh Sengar 2020-02-13 1951
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1952 /* reserved for future extensions */
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1953 if (config->flags)
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1954 return -EINVAL;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1955
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1956 /* Read the current value in the MAC TX CTRL register */
b83c55d11cbd986 Harini Katakam 2020-09-24 1957 if (lp->axienet_config->mactype != XAXIENET_10G_25G)
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1958 regval = axienet_ior(lp, XAE_TC_OFFSET);
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1959
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1960 switch (config->tx_type) {
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1961 case HWTSTAMP_TX_OFF:
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 @1962 regval &= ~XAE_TC_INBAND1588_MASK;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1963 break;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1964 case HWTSTAMP_TX_ON:
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1965 config->tx_type = HWTSTAMP_TX_ON;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1966 regval |= XAE_TC_INBAND1588_MASK;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1967 break;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1968 case HWTSTAMP_TX_ONESTEP_SYNC:
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1969 config->tx_type = HWTSTAMP_TX_ONESTEP_SYNC;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1970 regval |= XAE_TC_INBAND1588_MASK;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1971 break;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1972 default:
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1973 return -ERANGE;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1974 }
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1975
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1976 if (lp->axienet_config->mactype != XAXIENET_10G_25G)
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1977 axienet_iow(lp, XAE_TC_OFFSET, regval);
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1978
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1979 /* Read the current value in the MAC RX RCW1 register */
b83c55d11cbd986 Harini Katakam 2020-09-24 1980 if (lp->axienet_config->mactype != XAXIENET_10G_25G)
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1981 regval = axienet_ior(lp, XAE_RCW1_OFFSET);
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1982
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1983 /* On RX always timestamp everything */
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1984 switch (config->rx_filter) {
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1985 case HWTSTAMP_FILTER_NONE:
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1986 regval &= ~XAE_RCW1_INBAND1588_MASK;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1987 break;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1988 default:
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1989 config->rx_filter = HWTSTAMP_FILTER_ALL;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1990 regval |= XAE_RCW1_INBAND1588_MASK;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1991 }
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1992
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1993 if (lp->axienet_config->mactype != XAXIENET_10G_25G)
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1994 axienet_iow(lp, XAE_RCW1_OFFSET, regval);
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1995
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1996 return 0;
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1997 }
6a8544f2f4d9002 Appana Durga Kedareswara Rao 2020-01-24 1998
:::::: The code at line 1962 was first introduced by commit
:::::: 6a8544f2f4d90023366c63699944ce4f7d0d5b5d 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] 61376 bytes
- (unnamed) [text/plain] 176 bytes · preview