From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/net/veth.c:1612:68: warning: Parameter 'tb' can be declared with const [constParameter]
Date: Sat, 25 Jun 2022 10:59:50 +0800 [thread overview]
Message-ID: <202206251032.aKSLmL8G-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3445 bytes --]
::::::
:::::: Manual check reason: "low confidence static check warning: drivers/net/veth.c:1612:68: warning: Parameter 'tb' can be declared with const [constParameter]"
::::::
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Paolo Abeni <pabeni@redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8c23f235a6a8ae43abea215812eb9d8cf4dd165e
commit: 9d3684c24a5232c2d7ea8f8a3e60fe235e6a9867 veth: create by default nr_possible_cpus queues
date: 11 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 11 months ago
compiler: microblaze-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
# apt-get install cppcheck
git checkout 9d3684c24a5232c2d7ea8f8a3e60fe235e6a9867
cppcheck --quiet --enable=style,performance,portability --template=gcc FILE
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
drivers/net/veth.c:1509:18: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
if ((!!old_prog ^ !!prog) && peer)
^
drivers/net/veth.c:146:5: warning: %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint]
snprintf(p, ETH_GSTRING_LEN,
^
drivers/net/veth.c:154:5: warning: %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint]
snprintf(p, ETH_GSTRING_LEN,
^
>> drivers/net/veth.c:1612:68: warning: Parameter 'tb' can be declared with const [constParameter]
static int veth_init_queues(struct net_device *dev, struct nlattr *tb[])
^
drivers/net/veth.c:1630:40: warning: Parameter 'data' can be declared with const [constParameter]
struct nlattr *tb[], struct nlattr *data[],
^
vim +/tb +1612 drivers/net/veth.c
d3256efd8e8b23 Paolo Abeni 2021-04-09 1611
9d3684c24a5232 Paolo Abeni 2021-07-20 @1612 static int veth_init_queues(struct net_device *dev, struct nlattr *tb[])
9d3684c24a5232 Paolo Abeni 2021-07-20 1613 {
9d3684c24a5232 Paolo Abeni 2021-07-20 1614 int err;
9d3684c24a5232 Paolo Abeni 2021-07-20 1615
9d3684c24a5232 Paolo Abeni 2021-07-20 1616 if (!tb[IFLA_NUM_TX_QUEUES] && dev->num_tx_queues > 1) {
9d3684c24a5232 Paolo Abeni 2021-07-20 1617 err = netif_set_real_num_tx_queues(dev, 1);
9d3684c24a5232 Paolo Abeni 2021-07-20 1618 if (err)
9d3684c24a5232 Paolo Abeni 2021-07-20 1619 return err;
9d3684c24a5232 Paolo Abeni 2021-07-20 1620 }
9d3684c24a5232 Paolo Abeni 2021-07-20 1621 if (!tb[IFLA_NUM_RX_QUEUES] && dev->num_rx_queues > 1) {
9d3684c24a5232 Paolo Abeni 2021-07-20 1622 err = netif_set_real_num_rx_queues(dev, 1);
9d3684c24a5232 Paolo Abeni 2021-07-20 1623 if (err)
9d3684c24a5232 Paolo Abeni 2021-07-20 1624 return err;
9d3684c24a5232 Paolo Abeni 2021-07-20 1625 }
9d3684c24a5232 Paolo Abeni 2021-07-20 1626 return 0;
9d3684c24a5232 Paolo Abeni 2021-07-20 1627 }
9d3684c24a5232 Paolo Abeni 2021-07-20 1628
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next reply other threads:[~2022-06-25 2:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-25 2:59 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-05-06 15:30 drivers/net/veth.c:1612:68: warning: Parameter 'tb' can be declared with const [constParameter] kernel test robot
2022-04-12 16:16 kernel test robot
2022-04-09 21:26 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=202206251032.aKSLmL8G-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@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.