From: Souptick Joarder <jrdr.linux@gmail.com>
To: kernel test robot <lkp@intel.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>,
kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
Linux Memory Management List <linux-mm@kvack.org>,
Jakub Kicinski <kuba@kernel.org>,
Ido Schimmel <idosch@nvidia.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Kurt Kanzenbach <kurt@linutronix.de>
Subject: Re: [linux-next:master 2144/2798] drivers/net/ethernet/marvell/prestera/prestera_switchdev.c:1049:11: warning: variable 'vid' is uninitialized when used here
Date: Sat, 16 Jan 2021 14:28:17 +0530 [thread overview]
Message-ID: <CAFqt6zZJBKDThBm5-60=8W1w+WHC=0NDKznGd9niaBPi+BsRVg@mail.gmail.com> (raw)
In-Reply-To: <202101141227.3CQFCbmL-lkp@intel.com>
On Thu, Jan 14, 2021 at 9:54 AM kernel test robot <lkp@intel.com> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: aa515cdce7a151dcc14b7600d33f1414c6fa32c9
> commit: b7a9e0da2d1c954b7c38217a29e002528b90d174 [2144/2798] net: switchdev: remove vid_begin -> vid_end range from VLAN objects
> config: x86_64-randconfig-a004-20210114 (attached as .config)
> compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 6077d55381a6aa3e947ef7abdc36a7515c598c8a)
> 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 x86_64 cross compiling tool for clang build
> # apt-get install binutils-x86-64-linux-gnu
> # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b7a9e0da2d1c954b7c38217a29e002528b90d174
> git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> git fetch --no-tags linux-next master
> git checkout b7a9e0da2d1c954b7c38217a29e002528b90d174
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
>
> 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 >>):
>
> >> drivers/net/ethernet/marvell/prestera/prestera_switchdev.c:1049:11: warning: variable 'vid' is uninitialized when used here [-Wuninitialized]
> vid, flag_untagged,
> ^~~
> drivers/net/ethernet/marvell/prestera/prestera_switchdev.c:1032:9: note: initialize the variable 'vid' to silence this warning
> u16 vid;
> ^
> = 0
> 1 warning generated.
>
>
> vim +/vid +1049 drivers/net/ethernet/marvell/prestera/prestera_switchdev.c
>
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1020
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1021 static int prestera_port_vlans_add(struct prestera_port *port,
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1022 const struct switchdev_obj_port_vlan *vlan,
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1023 struct switchdev_trans *trans,
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1024 struct netlink_ext_ack *extack)
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1025 {
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1026 bool flag_untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1027 bool flag_pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1028 struct net_device *dev = vlan->obj.orig_dev;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1029 struct prestera_bridge_port *br_port;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1030 struct prestera_switch *sw = port->sw;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1031 struct prestera_bridge *bridge;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1032 u16 vid;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1033
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1034 if (netif_is_bridge_master(dev))
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1035 return 0;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1036
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1037 if (switchdev_trans_ph_commit(trans))
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1038 return 0;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1039
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1040 br_port = prestera_bridge_port_by_dev(sw->swdev, dev);
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1041 if (WARN_ON(!br_port))
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1042 return -EINVAL;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1043
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1044 bridge = br_port->bridge;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1045 if (!bridge->vlan_enabled)
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1046 return 0;
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1047
> b7a9e0da2d1c954b Vladimir Oltean 2021-01-09 1048 return prestera_bridge_port_vlan_add(port, br_port,
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 @1049 vid, flag_untagged,
Currently vid is passed as garbage value. Is initializing vid = 0 and
passing it to prestera_bridge_port_vlan_add()
the right thing to do ? Or do we need to pass more appropriate values ?
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1050 flag_pvid, extack);
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1051 }
> e1189d9a5fbec815 Vadym Kochan 2020-09-16 1052
>
> :::::: The code at line 1049 was first introduced by commit
> :::::: e1189d9a5fbec8153dbe03f3589bc2baa96694e2 net: marvell: prestera: Add Switchdev driver implementation
>
> :::::: TO: Vadym Kochan <vadym.kochan@plvision.eu>
> :::::: CC: David S. Miller <davem@davemloft.net>
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next prev parent reply other threads:[~2021-01-16 8:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-14 4:24 kernel test robot
2021-01-16 8:58 ` Souptick Joarder [this message]
2021-01-16 9:03 ` Souptick Joarder
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='CAFqt6zZJBKDThBm5-60=8W1w+WHC=0NDKznGd9niaBPi+BsRVg@mail.gmail.com' \
--to=jrdr.linux@gmail.com \
--cc=clang-built-linux@googlegroups.com \
--cc=f.fainelli@gmail.com \
--cc=idosch@nvidia.com \
--cc=kbuild-all@lists.01.org \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=vladimir.oltean@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox