All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH net] net: dsa: Centralize validation of VLAN configuration
Date: Wed, 17 Mar 2021 02:00:31 +0800	[thread overview]
Message-ID: <202103170109.NPKdBuBu-lkp@intel.com> (raw)
In-Reply-To: <20210315195413.2679929-1-tobias@waldekranz.com>

[-- Attachment #1: Type: text/plain, Size: 4854 bytes --]

Hi Tobias,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net/master]

url:    https://github.com/0day-ci/linux/commits/Tobias-Waldekranz/net-dsa-Centralize-validation-of-VLAN-configuration/20210316-035618
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git a25f822285420486f5da434efc8d940d42a83bce
config: powerpc-randconfig-r006-20210316 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 50c7504a93fdb90c26870db8c8ea7add895c7725)
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 powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://github.com/0day-ci/linux/commit/9a35f7597b676a3bdaa9dd753e0a7d11fb132ed5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Tobias-Waldekranz/net-dsa-Centralize-validation-of-VLAN-configuration/20210316-035618
        git checkout 9a35f7597b676a3bdaa9dd753e0a7d11fb132ed5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> net/dsa/slave.c:2074:12: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                   else if (is_vlan_dev(info->upper_dev))
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/dsa/slave.c:2077:7: note: uninitialized use occurs here
                   if (err)
                       ^~~
   net/dsa/slave.c:2074:8: note: remove the 'if' if its condition is always true
                   else if (is_vlan_dev(info->upper_dev))
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/dsa/slave.c:2070:10: note: initialize the variable 'err' to silence this warning
                   int err;
                          ^
                           = 0
   1 warning generated.


vim +2074 net/dsa/slave.c

  2059	
  2060	static int dsa_slave_netdevice_event(struct notifier_block *nb,
  2061					     unsigned long event, void *ptr)
  2062	{
  2063		struct net_device *dev = netdev_notifier_info_to_dev(ptr);
  2064	
  2065		switch (event) {
  2066		case NETDEV_PRECHANGEUPPER: {
  2067			struct netdev_notifier_changeupper_info *info = ptr;
  2068			struct dsa_switch *ds;
  2069			struct dsa_port *dp;
  2070			int err;
  2071	
  2072			if (is_vlan_dev(dev))
  2073				err = dsa_prevent_bridging_8021q_upper(dev, ptr);
> 2074			else if (is_vlan_dev(info->upper_dev))
  2075				err = dsa_slave_check_8021q_upper(dev, ptr);
  2076	
  2077			if (err)
  2078				return err;
  2079	
  2080			if (!dsa_slave_dev_check(dev))
  2081				return NOTIFY_DONE;
  2082	
  2083			dp = dsa_slave_to_port(dev);
  2084			ds = dp->ds;
  2085	
  2086			if (ds->ops->port_prechangeupper) {
  2087				err = ds->ops->port_prechangeupper(ds, dp->index, info);
  2088				if (err)
  2089					return notifier_from_errno(err);
  2090			}
  2091			break;
  2092		}
  2093		case NETDEV_CHANGEUPPER:
  2094			if (dsa_slave_dev_check(dev))
  2095				return dsa_slave_changeupper(dev, ptr);
  2096	
  2097			if (netif_is_lag_master(dev))
  2098				return dsa_slave_lag_changeupper(dev, ptr);
  2099	
  2100			break;
  2101		case NETDEV_CHANGELOWERSTATE: {
  2102			struct netdev_notifier_changelowerstate_info *info = ptr;
  2103			struct dsa_port *dp;
  2104			int err;
  2105	
  2106			if (!dsa_slave_dev_check(dev))
  2107				break;
  2108	
  2109			dp = dsa_slave_to_port(dev);
  2110	
  2111			err = dsa_port_lag_change(dp, info->lower_state_info);
  2112			return notifier_from_errno(err);
  2113		}
  2114		case NETDEV_GOING_DOWN: {
  2115			struct dsa_port *dp, *cpu_dp;
  2116			struct dsa_switch_tree *dst;
  2117			LIST_HEAD(close_list);
  2118	
  2119			if (!netdev_uses_dsa(dev))
  2120				return NOTIFY_DONE;
  2121	
  2122			cpu_dp = dev->dsa_ptr;
  2123			dst = cpu_dp->ds->dst;
  2124	
  2125			list_for_each_entry(dp, &dst->ports, list) {
  2126				if (!dsa_is_user_port(dp->ds, dp->index))
  2127					continue;
  2128	
  2129				list_add(&dp->slave->close_list, &close_list);
  2130			}
  2131	
  2132			dev_close_many(&close_list, true);
  2133	
  2134			return NOTIFY_OK;
  2135		}
  2136		default:
  2137			break;
  2138		}
  2139	
  2140		return NOTIFY_DONE;
  2141	}
  2142	

---
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: 45992 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Tobias Waldekranz <tobias@waldekranz.com>,
	davem@davemloft.net, kuba@kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com,
	olteanv@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH net] net: dsa: Centralize validation of VLAN configuration
Date: Wed, 17 Mar 2021 02:00:31 +0800	[thread overview]
Message-ID: <202103170109.NPKdBuBu-lkp@intel.com> (raw)
In-Reply-To: <20210315195413.2679929-1-tobias@waldekranz.com>

[-- Attachment #1: Type: text/plain, Size: 4719 bytes --]

Hi Tobias,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net/master]

url:    https://github.com/0day-ci/linux/commits/Tobias-Waldekranz/net-dsa-Centralize-validation-of-VLAN-configuration/20210316-035618
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git a25f822285420486f5da434efc8d940d42a83bce
config: powerpc-randconfig-r006-20210316 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 50c7504a93fdb90c26870db8c8ea7add895c7725)
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 powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://github.com/0day-ci/linux/commit/9a35f7597b676a3bdaa9dd753e0a7d11fb132ed5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Tobias-Waldekranz/net-dsa-Centralize-validation-of-VLAN-configuration/20210316-035618
        git checkout 9a35f7597b676a3bdaa9dd753e0a7d11fb132ed5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> net/dsa/slave.c:2074:12: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                   else if (is_vlan_dev(info->upper_dev))
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/dsa/slave.c:2077:7: note: uninitialized use occurs here
                   if (err)
                       ^~~
   net/dsa/slave.c:2074:8: note: remove the 'if' if its condition is always true
                   else if (is_vlan_dev(info->upper_dev))
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/dsa/slave.c:2070:10: note: initialize the variable 'err' to silence this warning
                   int err;
                          ^
                           = 0
   1 warning generated.


vim +2074 net/dsa/slave.c

  2059	
  2060	static int dsa_slave_netdevice_event(struct notifier_block *nb,
  2061					     unsigned long event, void *ptr)
  2062	{
  2063		struct net_device *dev = netdev_notifier_info_to_dev(ptr);
  2064	
  2065		switch (event) {
  2066		case NETDEV_PRECHANGEUPPER: {
  2067			struct netdev_notifier_changeupper_info *info = ptr;
  2068			struct dsa_switch *ds;
  2069			struct dsa_port *dp;
  2070			int err;
  2071	
  2072			if (is_vlan_dev(dev))
  2073				err = dsa_prevent_bridging_8021q_upper(dev, ptr);
> 2074			else if (is_vlan_dev(info->upper_dev))
  2075				err = dsa_slave_check_8021q_upper(dev, ptr);
  2076	
  2077			if (err)
  2078				return err;
  2079	
  2080			if (!dsa_slave_dev_check(dev))
  2081				return NOTIFY_DONE;
  2082	
  2083			dp = dsa_slave_to_port(dev);
  2084			ds = dp->ds;
  2085	
  2086			if (ds->ops->port_prechangeupper) {
  2087				err = ds->ops->port_prechangeupper(ds, dp->index, info);
  2088				if (err)
  2089					return notifier_from_errno(err);
  2090			}
  2091			break;
  2092		}
  2093		case NETDEV_CHANGEUPPER:
  2094			if (dsa_slave_dev_check(dev))
  2095				return dsa_slave_changeupper(dev, ptr);
  2096	
  2097			if (netif_is_lag_master(dev))
  2098				return dsa_slave_lag_changeupper(dev, ptr);
  2099	
  2100			break;
  2101		case NETDEV_CHANGELOWERSTATE: {
  2102			struct netdev_notifier_changelowerstate_info *info = ptr;
  2103			struct dsa_port *dp;
  2104			int err;
  2105	
  2106			if (!dsa_slave_dev_check(dev))
  2107				break;
  2108	
  2109			dp = dsa_slave_to_port(dev);
  2110	
  2111			err = dsa_port_lag_change(dp, info->lower_state_info);
  2112			return notifier_from_errno(err);
  2113		}
  2114		case NETDEV_GOING_DOWN: {
  2115			struct dsa_port *dp, *cpu_dp;
  2116			struct dsa_switch_tree *dst;
  2117			LIST_HEAD(close_list);
  2118	
  2119			if (!netdev_uses_dsa(dev))
  2120				return NOTIFY_DONE;
  2121	
  2122			cpu_dp = dev->dsa_ptr;
  2123			dst = cpu_dp->ds->dst;
  2124	
  2125			list_for_each_entry(dp, &dst->ports, list) {
  2126				if (!dsa_is_user_port(dp->ds, dp->index))
  2127					continue;
  2128	
  2129				list_add(&dp->slave->close_list, &close_list);
  2130			}
  2131	
  2132			dev_close_many(&close_list, true);
  2133	
  2134			return NOTIFY_OK;
  2135		}
  2136		default:
  2137			break;
  2138		}
  2139	
  2140		return NOTIFY_DONE;
  2141	}
  2142	

---
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: 45992 bytes --]

  parent reply	other threads:[~2021-03-16 18:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 19:54 [PATCH net] net: dsa: Centralize validation of VLAN configuration Tobias Waldekranz
2021-03-15 23:49 ` Vladimir Oltean
2021-03-16 16:08   ` Tobias Waldekranz
2021-03-16 21:49     ` Vladimir Oltean
2021-03-16 22:40       ` Tobias Waldekranz
2021-03-16 22:47         ` Vladimir Oltean
2021-03-16 18:00 ` kernel test robot [this message]
2021-03-16 18:00   ` 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=202103170109.NPKdBuBu-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.