From: kernel test robot <lkp@intel.com>
To: Vlad Buslov <vladbu@nvidia.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org, Saeed Mahameed <saeedm@nvidia.com>,
Maor Dickman <maord@nvidia.com>, Roi Dayan <roid@nvidia.com>
Subject: drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c:1833:4: warning: 'snprintf' will always be truncated; specified size is 80, but format string expands to at least 94
Date: Wed, 10 Jan 2024 22:55:22 +0800 [thread overview]
Message-ID: <202401102205.XmxWrS5y-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ab27740f76654ed58dd32ac0ba0031c18a6dea3b
commit: 70f0302b3f2053b64a6a653a76a20cb95438dc85 net/mlx5: Bridge, implement mdb offload
date: 9 months ago
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20240110/202401102205.XmxWrS5y-lkp@intel.com/config)
compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 7e186d366d6c7def0543acc255931f617e76dff0)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240110/202401102205.XmxWrS5y-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401102205.XmxWrS5y-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c:1833:4: warning: 'snprintf' will always be truncated; specified size is 80, but format string expands to at least 94 [-Wformat-truncation-non-kprintf]
1833 | NL_SET_ERR_MSG_FMT_MOD(extack,
| ^
include/linux/netlink.h:130:2: note: expanded from macro 'NL_SET_ERR_MSG_FMT_MOD'
130 | NL_SET_ERR_MSG_FMT((extack), KBUILD_MODNAME ": " fmt, ##args)
| ^
include/linux/netlink.h:115:6: note: expanded from macro 'NL_SET_ERR_MSG_FMT'
115 | if (snprintf(__extack->_msg_buf, NETLINK_MAX_FMTMSG_LEN, \
| ^
1 warning generated.
vim +/snprintf +1833 drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
1805
1806 int mlx5_esw_bridge_port_mdb_add(u16 vport_num, u16 esw_owner_vhca_id, const unsigned char *addr,
1807 u16 vid, struct mlx5_esw_bridge_offloads *br_offloads,
1808 struct netlink_ext_ack *extack)
1809 {
1810 struct mlx5_esw_bridge_vlan *vlan;
1811 struct mlx5_esw_bridge_port *port;
1812 struct mlx5_esw_bridge *bridge;
1813 int err;
1814
1815 port = mlx5_esw_bridge_port_lookup(vport_num, esw_owner_vhca_id, br_offloads);
1816 if (!port) {
1817 esw_warn(br_offloads->esw->dev,
1818 "Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)\n",
1819 addr, vport_num);
1820 NL_SET_ERR_MSG_FMT_MOD(extack,
1821 "Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)\n",
1822 addr, vport_num);
1823 return -EINVAL;
1824 }
1825
1826 bridge = port->bridge;
1827 if (bridge->flags & MLX5_ESW_BRIDGE_VLAN_FILTERING_FLAG && vid) {
1828 vlan = mlx5_esw_bridge_vlan_lookup(vid, port);
1829 if (!vlan) {
1830 esw_warn(br_offloads->esw->dev,
1831 "Failed to lookup bridge port vlan metadata to create MDB (MAC=%pM,vid=%u,vport=%u)\n",
1832 addr, vid, vport_num);
> 1833 NL_SET_ERR_MSG_FMT_MOD(extack,
1834 "Failed to lookup bridge port vlan metadata to create MDB (MAC=%pM,vid=%u,vport=%u)\n",
1835 addr, vid, vport_num);
1836 return -EINVAL;
1837 }
1838 }
1839
1840 err = mlx5_esw_bridge_port_mdb_attach(port, addr, vid);
1841 if (err) {
1842 NL_SET_ERR_MSG_FMT_MOD(extack, "Failed to add MDB (MAC=%pM,vid=%u,vport=%u)\n",
1843 addr, vid, vport_num);
1844 return err;
1845 }
1846
1847 return 0;
1848 }
1849
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2024-01-10 14:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 14:55 kernel test robot [this message]
2024-01-12 19:47 ` drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c:1833:4: warning: 'snprintf' will always be truncated; specified size is 80, but format string expands to at least 94 Nathan Chancellor
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=202401102205.XmxWrS5y-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=maord@nvidia.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=roid@nvidia.com \
--cc=saeedm@nvidia.com \
--cc=vladbu@nvidia.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