All of lore.kernel.org
 help / color / mirror / Atom feed
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: Wed, 13 Apr 2022 00:16:55 +0800	[thread overview]
Message-ID: <202204130000.rIiu28CD-lkp@intel.com> (raw)

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

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:   ce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e
commit: 9d3684c24a5232c2d7ea8f8a3e60fe235e6a9867 veth: create by default nr_possible_cpus queues
date:   9 months ago
:::::: branch date: 2 days ago
:::::: commit date: 9 months ago
compiler: arc-elf-gcc (GCC) 11.2.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 as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> net/nfc/llcp_sock.c:622:29: warning: Uninitialized variables: lsk.sk, lsk.dev, lsk.local, lsk.target_idx, lsk.nfc_protocol, lsk.ssap, lsk.dsap, lsk.service_name, lsk.service_name_len, lsk.rw, lsk.miux, lsk.remote_rw, lsk.remote_miu, lsk.send_n, lsk.send_ack_n, lsk.recv_n, lsk.recv_ack_n, lsk.remote_ready, lsk.reserved_ssap, lsk.tx_queue, lsk.tx_pending_queue, lsk.accept_queue, lsk.parent [uninitvar]
      nfc_llcp_send_disconnect(lsk);
                               ^
--
   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[],
                                          ^
>> net/mpls/af_mpls.c:693:6: warning: Redundant initialization for 'err'. The initialized value is overwritten before it is read. [redundantInitialization]
    err = -EINVAL;
        ^
   net/mpls/af_mpls.c:683:10: note: err is initialized
    int err = -ENODEV;
            ^
   net/mpls/af_mpls.c:693:6: note: err is overwritten
    err = -EINVAL;
        ^
>> net/mpls/af_mpls.c:2494:41: warning: Found suspicious operator ',' [constStatement]
    struct mpls_route __rcu **labels = NULL, **old;
                                           ^

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

             reply	other threads:[~2022-04-12 16:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 16:16 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-06-25  2:59 drivers/net/veth.c:1612:68: warning: Parameter 'tb' can be declared with const [constParameter] kernel test robot
2022-05-06 15:30 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=202204130000.rIiu28CD-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.