From: kernel test robot <lkp@intel.com>
To: Harini Katakam <harini.katakam@xilinx.com>
Cc: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org,
Michal Simek <monstr@monstr.eu>,
Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Subject: [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
Date: Thu, 22 Jul 2021 21:13:47 +0800 [thread overview]
Message-ID: <202107222128.CDlUbks5-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 7134 bytes --]
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 <lkp@intel.com>
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':
>> 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 <appana.durga.rao@xilinx.com>
:::::: CC: Michal Simek <michal.simek@xilinx.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 18524 bytes --]
[-- Attachment #3: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [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
Date: Thu, 22 Jul 2021 21:13:47 +0800 [thread overview]
Message-ID: <202107222128.CDlUbks5-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 7245 bytes --]
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 <lkp@intel.com>
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':
>> 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 <appana.durga.rao@xilinx.com>
:::::: CC: Michal Simek <michal.simek@xilinx.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 18524 bytes --]
next reply other threads:[~2021-07-22 13:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-22 13:13 kernel test robot [this message]
2021-07-22 13:13 ` [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 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202107222128.CDlUbks5-lkp@intel.com \
--to=lkp@intel.com \
--cc=harini.katakam@xilinx.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=monstr@monstr.eu \
--cc=radhey.shyam.pandey@xilinx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.