All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/net/veth.c:1612:68: warning: Parameter 'tb' can be declared with const [constParameter]
@ 2022-04-09 21:26 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-04-09 21:26 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4205 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:   e1f700ebd6bea293abe3c7e2807b252018efde01
commit: 9d3684c24a5232c2d7ea8f8a3e60fe235e6a9867 veth: create by default nr_possible_cpus queues
date:   9 months ago
:::::: branch date: 5 hours ago
:::::: commit date: 9 months ago
compiler: arm-linux-gnueabi-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/ipv6/inet6_hashtables.c:163:29: warning: Parameter 'hashinfo' can be declared with const [constParameter]
         struct inet_hashinfo *hashinfo,
                               ^
--
   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/sunrpc/svc_xprt.c:1075:91: warning: Parameter 'net' can be declared with const [constParameter]
   static int svc_close_list(struct svc_serv *serv, struct list_head *xprt_list, struct net *net)
                                                                                             ^
   net/sunrpc/svc_xprt.c:1092:76: warning: Parameter 'net' can be declared with const [constParameter]
   static struct svc_xprt *svc_dequeue_net(struct svc_serv *serv, struct net *net)
                                                                              ^
   net/sunrpc/svc_xprt.c:1289:23: warning: Parameter 'net' can be declared with const [constParameter]
             struct net *net, const sa_family_t af,
                         ^

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/net/veth.c:1612:68: warning: Parameter 'tb' can be declared with const [constParameter]
@ 2022-04-12 16:16 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-04-12 16:16 UTC (permalink / raw)
  To: kbuild

[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/net/veth.c:1612:68: warning: Parameter 'tb' can be declared with const [constParameter]
@ 2022-05-06 15:30 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-05-06 15:30 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 14416 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:   fe27d189e3f42e31d3c8223d5daed7285e334c5e
commit: 9d3684c24a5232c2d7ea8f8a3e60fe235e6a9867 veth: create by default nr_possible_cpus queues
date:   10 months ago
:::::: branch date: 16 hours ago
:::::: commit date: 10 months ago
compiler: aarch64-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 as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck warnings: (new ones prefixed by >>)
>> drivers/net/wireless/ath/ath11k/mac.c:2253:7: warning: Local variable 'preamble' shadows outer variable [shadowVariable]
     u32 preamble;
         ^
   drivers/net/wireless/ath/ath11k/mac.c:2112:6: note: Shadowed declaration
    u32 preamble;
        ^
   drivers/net/wireless/ath/ath11k/mac.c:2253:7: note: Shadow variable
     u32 preamble;
         ^

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

>> drivers/net/wireless/ath/ath11k/peer.c:18:13: warning: Uninitialized variable: peer->vdev_id [uninitvar]
     if (peer->vdev_id != vdev_id)
               ^
   drivers/net/wireless/ath/ath11k/peer.c:37:13: warning: Uninitialized variable: peer->pdev_idx [uninitvar]
     if (peer->pdev_idx != pdev_idx)
               ^
   drivers/net/wireless/ath/ath11k/peer.c:59:10: warning: Uninitialized variables: peer.list, peer.sta, peer.vdev_id, peer.peer_id, peer.ast_hash, peer.pdev_idx, peer.hw_peer_id, peer.tfm_mmic, peer.mcast_keyidx, peer.ucast_keyidx, peer.sec_type, peer.sec_type_grp [uninitvar]
     return peer;
            ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:56:7: note: Assuming condition is false
     if (!ether_addr_equal(peer->addr, addr))
         ^
   drivers/net/wireless/ath/ath11k/peer.c:59:10: note: Uninitialized variables: peer.list, peer.sta, peer.vdev_id, peer.peer_id, peer.ast_hash, peer.pdev_idx, peer.hw_peer_id, peer.tfm_mmic, peer.mcast_keyidx, peer.ucast_keyidx, peer.sec_type, peer.sec_type_grp
     return peer;
            ^
   drivers/net/wireless/ath/ath11k/peer.c:87:24: warning: Uninitialized variable: peer->vdev_id [uninitvar]
     if (vdev_id == peer->vdev_id) {
                          ^
   drivers/net/wireless/ath/ath11k/peer.c:179:13: warning: Uninitialized variable: peer->vdev_id [uninitvar]
     if (peer->vdev_id != vdev_id)
               ^
--
>> drivers/net/wireless/ath/ath11k/spectral.c:426:8: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
    len = sprintf(buf, "%dn", bins);
          ^
>> drivers/net/wireless/ath/ath11k/spectral.c:535:28: warning: Parameter 'bins' can be declared with const [constParameter]
             int bin_len, u8 *bins)
                              ^
>> drivers/net/wireless/ath/ath11k/spectral.c:558:56: warning: Parameter 'inbins' can be declared with const [constParameter]
   static void ath11k_spectral_parse_fft(u8 *outbins, u8 *inbins, int num_bins, u8 fft_sz)
                                                          ^
--
   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[],
                                          ^
>> drivers/net/wireless/ath/ath9k/ar9003_paprd.c:249:3: warning: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS]
     REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
     ^
   drivers/net/wireless/ath/ath9k/ar9003_paprd.c:252:3: warning: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS]
     REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
     ^
   drivers/net/wireless/ath/ath9k/ar9003_paprd.c:260:2: warning: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS]
    REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
    ^
   drivers/net/wireless/ath/ath9k/ar9003_paprd.c:909:2: warning: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS]
    REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
    ^
>> drivers/net/wireless/ath/ath9k/ar9003_paprd.c:419:34: warning: Parameter 'data_L' can be declared with const [constParameter]
   static bool create_pa_curve(u32 *data_L, u32 *data_U, u32 *pa_table, u16 *gain)
                                    ^
>> drivers/net/wireless/ath/ath9k/ar9003_paprd.c:419:47: warning: Parameter 'data_U' can be declared with const [constParameter]
   static bool create_pa_curve(u32 *data_L, u32 *data_U, u32 *pa_table, u16 *gain)
                                                 ^
--
>> drivers/net/wireless/ath/ath6kl/htc_mbox.c:1095:9: warning: Parameter 'srvc_pri_order' can be declared with const [constParameter]
       u16 srvc_pri_order[], int list_len)
           ^
>> drivers/net/wireless/ath/ath6kl/htc_mbox.c:65:20: warning: Uninitialized variable: cur_ep_dist->endpoint [uninitvar]
     if (cur_ep_dist->endpoint == ENDPOINT_0)
                      ^
>> drivers/net/wireless/ath/ath6kl/htc_mbox.c:191:17: warning: Uninitialized variable: cur_list->endpoint [uninitvar]
     if (cur_list->endpoint == ENDPOINT_0)
                   ^
>> drivers/net/wireless/ath/ath6kl/htc_mbox.c:302:21: warning: Uninitialized variable: curdist_list->endpoint [uninitvar]
     if (curdist_list->endpoint == ENDPOINT_0)
                       ^
>> drivers/net/wireless/ath/ath6kl/trace.h:105:3: warning: syntax error: keyword 'if' is not allowed in global scope [syntaxError]
     if (flags & HIF_WRITE)
     ^
--
        ^
>> drivers/net/wireless/ath/ath10k/sdio.c:1466:12: warning: Uninitialized variable: req->address [uninitvar]
     if (req->address >= mbox_info->htc_addr &&
              ^
>> drivers/net/wireless/ath/ath10k/sdio.c:1984:12: warning: Uninitialized variable: req->htc_msg [uninitvar]
     if (req->htc_msg) {
              ^
>> drivers/net/wireless/ath/ath10k/sdio.c:2228:9: warning: Uninitialized variable: ret [uninitvar]
    return ret;
           ^
   drivers/net/wireless/ath/ath10k/sdio.c:2219:16: note: Assuming condition is false
    for (i = 0; i < buf_len; i += 4) {
                  ^
   drivers/net/wireless/ath/ath10k/sdio.c:2228:9: note: Uninitialized variable: ret
    return ret;
           ^
--
                          ^
>> drivers/net/wireless/ath/ath9k/ar9003_calib.c:1343:6: warning: Variable 'cl_idx' can be declared with const [constVariable]
    u32 cl_idx[AR9300_MAX_CHAINS] = { AR_PHY_CL_TAB_0,
        ^
>> drivers/net/wireless/ath/ath10k/core.c:3040:28: warning: Shifting signed 64-bit value by 63 bits is implementation-defined behaviour. See condition at line 3037. [shiftTooManyBitsSigned]
     ar->free_vdev_map = (1LL << ar->max_num_vdevs) - 1;
                              ^
   drivers/net/wireless/ath/ath10k/core.c:3037:24: note: Assuming that condition 'ar->max_num_vdevs>=64' is not redundant
    if (ar->max_num_vdevs >= 64)
                          ^
   drivers/net/wireless/ath/ath10k/core.c:3040:28: note: Shift
     ar->free_vdev_map = (1LL << ar->max_num_vdevs) - 1;
                              ^
--
>> drivers/net/wireless/ath/ath9k/xmit.c:997:5: warning: Redundant initialization for 'bf'. The initialized value is overwritten before it is read. [redundantInitialization]
    bf = bf_first;
       ^
   drivers/net/wireless/ath/ath9k/xmit.c:988:21: note: bf is initialized
    struct ath_buf *bf = bf_first, *bf_prev = NULL;
                       ^
   drivers/net/wireless/ath/ath9k/xmit.c:997:5: note: bf is overwritten
    bf = bf_first;
       ^
>> drivers/net/wireless/ath/ath9k/common-spectral.h:112:46: warning: Parameter 'bins' can be declared with const [constParameter]
   static inline u16 spectral_max_magnitude(u8 *bins)
                                                ^
   drivers/net/wireless/ath/ath9k/common-spectral.h:120:41: warning: Parameter 'bins' can be declared with const [constParameter]
   static inline u8 spectral_max_index(u8 *bins, int num_bins)
                                           ^
   drivers/net/wireless/ath/ath9k/common-spectral.h:166:45: warning: Parameter 'bins' can be declared with const [constParameter]
   static inline u8 spectral_bitmap_weight(u8 *bins)
                                               ^
>> drivers/net/wireless/ath/ath9k/xmit.c:431:28: warning: Shifting signed 32-bit value by 31 bits is implementation-defined behaviour. See condition at line 431. [shiftTooManyBitsSigned]
     if (!txok || (isaggr && !ATH_BA_ISSET(ba, ba_index)))
                              ^
   drivers/net/wireless/ath/ath9k/xmit.c:431:28: note: Assuming that condition '(ba_index)<64' is not redundant
     if (!txok || (isaggr && !ATH_BA_ISSET(ba, ba_index)))
                              ^
   drivers/net/wireless/ath/ath9k/xmit.c:431:28: note: Shift
     if (!txok || (isaggr && !ATH_BA_ISSET(ba, ba_index)))
                              ^
>> drivers/net/wireless/ath/ath9k/xmit.c:431:28: warning: Either the condition '(ba_index)<64' is redundant or there is signed integer overflow for expression '1<<((ba_index)&31)'. [integerOverflowCond]
     if (!txok || (isaggr && !ATH_BA_ISSET(ba, ba_index)))
                              ^
   drivers/net/wireless/ath/ath9k/xmit.c:431:28: note: Assuming that condition '(ba_index)<64' is not redundant
     if (!txok || (isaggr && !ATH_BA_ISSET(ba, ba_index)))
                              ^
   drivers/net/wireless/ath/ath9k/xmit.c:431:28: note: Integer overflow
     if (!txok || (isaggr && !ATH_BA_ISSET(ba, ba_index)))
                              ^
>> drivers/net/wireless/ath/ath11k/mac.c:6059:33: warning: Parameter 'channel' can be declared with const [constParameter]
         struct ieee80211_channel *channel)
                                   ^
>> drivers/net/wireless/ath/ath11k/mac.c:1941:7: warning: Uninitialized variable: ret [uninitvar]
    if (!ret)
         ^
   drivers/net/wireless/ath/ath11k/mac.c:708:34: warning: Uninitialized variables: peer.list, peer.sta, peer.vdev_id, peer.peer_id, peer.ast_hash, peer.pdev_idx, peer.hw_peer_id, peer.tfm_mmic, peer.mcast_keyidx, peer.ucast_keyidx, peer.sec_type, peer.sec_type_grp [uninitvar]
     ath11k_peer_rx_tid_cleanup(ar, peer);
                                    ^

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/net/veth.c:1612:68: warning: Parameter 'tb' can be declared with const [constParameter]
@ 2022-06-25  2:59 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-06-25  2:59 UTC (permalink / raw)
  To: kbuild

[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-25  2:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-25  2:59 drivers/net/veth.c:1612:68: warning: Parameter 'tb' can be declared with const [constParameter] kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-05-06 15:30 kernel test robot
2022-04-12 16:16 kernel test robot
2022-04-09 21:26 kernel test robot

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.