CC: [email protected]
CC: [email protected]
TO: Luc Van Oostenryck <[email protected]>
CC: Andrew Morton <[email protected]>
CC: Linux Memory Management List <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   ccfff0a2bd2a30de130b5623d242ddecd0272bc2
commit: d991bb1c8da842a2a0b9dc83b1005e655783f861 include/linux/compiler-gcc.h: 
sparse can do constant folding of __builtin_bswap*()
date:   7 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 7 months ago
config: powerpc-randconfig-m031-20211016 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
drivers/net/wireless/ath/ath10k/wmi.c:2569 ath10k_wmi_event_mgmt_rx() warn: 
'snr + -95' 4294967201 can't fit into 127 'status->signal'

vim +2569 drivers/net/wireless/ath/ath10k/wmi.c

cc123fac978f46 Rakesh Pillai         2019-01-25  2498  
0226d6025845d0 Michal Kazior         2014-12-03  2499  int 
ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
32653cf19554dd Michal Kazior         2014-12-03  2500  {
32653cf19554dd Michal Kazior         2014-12-03  2501   struct 
wmi_mgmt_rx_ev_arg arg = {};
5e3dd157d7e70f Kalle Valo            2013-06-12  2502   struct 
ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
5e3dd157d7e70f Kalle Valo            2013-06-12  2503   struct ieee80211_hdr 
*hdr;
01cebe1c50d43a Michal Kazior         2015-03-30  2504   struct 
ieee80211_supported_band *sband;
5e3dd157d7e70f Kalle Valo            2013-06-12  2505   u32 rx_status;
5e3dd157d7e70f Kalle Valo            2013-06-12  2506   u32 channel;
5e3dd157d7e70f Kalle Valo            2013-06-12  2507   u32 phy_mode;
7005eafc1f1cb0 Wen Gong              2019-11-14  2508   u32 snr, rssi;
5e3dd157d7e70f Kalle Valo            2013-06-12  2509   u32 rate;
5e3dd157d7e70f Kalle Valo            2013-06-12  2510   u16 fc;
7005eafc1f1cb0 Wen Gong              2019-11-14  2511   int ret, i;
5e3dd157d7e70f Kalle Valo            2013-06-12  2512  
d7579d12c33f87 Michal Kazior         2014-12-03  2513   ret = 
ath10k_wmi_pull_mgmt_rx(ar, skb, &arg);
32653cf19554dd Michal Kazior         2014-12-03  2514   if (ret) {
32653cf19554dd Michal Kazior         2014-12-03  2515           ath10k_warn(ar, 
"failed to parse mgmt rx event: %d\n", ret);
08603f2e1c3183 Raja Mani             2015-06-01  2516           
dev_kfree_skb(skb);
32653cf19554dd Michal Kazior         2014-12-03  2517           return ret;
0d9b0438b61647 Michal Kazior         2013-08-09  2518   }
0d9b0438b61647 Michal Kazior         2013-08-09  2519  
32653cf19554dd Michal Kazior         2014-12-03  2520   channel = 
__le32_to_cpu(arg.channel);
32653cf19554dd Michal Kazior         2014-12-03  2521   rx_status = 
__le32_to_cpu(arg.status);
32653cf19554dd Michal Kazior         2014-12-03  2522   snr = 
__le32_to_cpu(arg.snr);
32653cf19554dd Michal Kazior         2014-12-03  2523   phy_mode = 
__le32_to_cpu(arg.phy_mode);
32653cf19554dd Michal Kazior         2014-12-03  2524   rate = 
__le32_to_cpu(arg.rate);
5e3dd157d7e70f Kalle Valo            2013-06-12  2525  
5e3dd157d7e70f Kalle Valo            2013-06-12  2526   memset(status, 0, 
sizeof(*status));
5e3dd157d7e70f Kalle Valo            2013-06-12  2527  
7aa7a72a23679a Michal Kazior         2014-08-25  2528   ath10k_dbg(ar, 
ATH10K_DBG_MGMT,
5e3dd157d7e70f Kalle Valo            2013-06-12  2529              "event mgmt 
rx status %08x\n", rx_status);
5e3dd157d7e70f Kalle Valo            2013-06-12  2530  
2c9bceced3a710 Manikanta Pubbisetty  2015-10-20  2531   if 
((test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags)) ||
2c9bceced3a710 Manikanta Pubbisetty  2015-10-20  2532       (rx_status & 
(WMI_RX_STATUS_ERR_DECRYPT |
2c9bceced3a710 Manikanta Pubbisetty  2015-10-20  2533       
WMI_RX_STATUS_ERR_KEY_CACHE_MISS | WMI_RX_STATUS_ERR_CRC))) {
d67d0a02042867 Michal Kazior         2014-11-24  2534           
dev_kfree_skb(skb);
d67d0a02042867 Michal Kazior         2014-11-24  2535           return 0;
d67d0a02042867 Michal Kazior         2014-11-24  2536   }
d67d0a02042867 Michal Kazior         2014-11-24  2537  
5e3dd157d7e70f Kalle Valo            2013-06-12  2538   if (rx_status & 
WMI_RX_STATUS_ERR_MIC)
5e3dd157d7e70f Kalle Valo            2013-06-12  2539           status->flag |= 
RX_FLAG_MMIC_ERROR;
5e3dd157d7e70f Kalle Valo            2013-06-12  2540  
8d130963d38a56 Peter Oh              2016-03-01  2541   if (rx_status & 
WMI_RX_STATUS_EXT_INFO) {
8d130963d38a56 Peter Oh              2016-03-01  2542           status->mactime 
=
8d130963d38a56 Peter Oh              2016-03-01  2543                   
__le64_to_cpu(arg.ext_info.rx_mac_timestamp);
8d130963d38a56 Peter Oh              2016-03-01  2544           status->flag |= 
RX_FLAG_MACTIME_END;
8d130963d38a56 Peter Oh              2016-03-01  2545   }
21040bf9cb02eb Michal Kazior         2014-10-21  2546   /* Hardware can Rx CCK 
rates on 5GHz. In that case phy_mode is set to
453cdb61c015f8 Michal Kazior         2013-12-13  2547    * MODE_11B. This means 
phy_mode is not a reliable source for the band
21040bf9cb02eb Michal Kazior         2014-10-21  2548    * of mgmt rx.
21040bf9cb02eb Michal Kazior         2014-10-21  2549    */
21040bf9cb02eb Michal Kazior         2014-10-21  2550   if (channel >= 1 && 
channel <= 14) {
57fbcce37be7c1 Johannes Berg         2016-04-12  2551           status->band = 
NL80211_BAND_2GHZ;
38441fb6fcbb97 Ben Greear            2018-01-02  2552   } else if (channel >= 
36 && channel <= ATH10K_MAX_5G_CHAN) {
57fbcce37be7c1 Johannes Berg         2016-04-12  2553           status->band = 
NL80211_BAND_5GHZ;
453cdb61c015f8 Michal Kazior         2013-12-13  2554   } else {
21040bf9cb02eb Michal Kazior         2014-10-21  2555           /* Shouldn't 
happen unless list of advertised channels to
21040bf9cb02eb Michal Kazior         2014-10-21  2556            * mac80211 has 
been changed.
21040bf9cb02eb Michal Kazior         2014-10-21  2557            */
21040bf9cb02eb Michal Kazior         2014-10-21  2558           WARN_ON_ONCE(1);
21040bf9cb02eb Michal Kazior         2014-10-21  2559           
dev_kfree_skb(skb);
21040bf9cb02eb Michal Kazior         2014-10-21  2560           return 0;
453cdb61c015f8 Michal Kazior         2013-12-13  2561   }
453cdb61c015f8 Michal Kazior         2013-12-13  2562  
57fbcce37be7c1 Johannes Berg         2016-04-12  2563   if (phy_mode == 
MODE_11B && status->band == NL80211_BAND_5GHZ)
21040bf9cb02eb Michal Kazior         2014-10-21  2564           ath10k_dbg(ar, 
ATH10K_DBG_MGMT, "wmi mgmt rx 11b (CCK) on 5GHz\n");
21040bf9cb02eb Michal Kazior         2014-10-21  2565  
01cebe1c50d43a Michal Kazior         2015-03-30  2566   sband = 
&ar->mac.sbands[status->band];
01cebe1c50d43a Michal Kazior         2015-03-30  2567  
5e3dd157d7e70f Kalle Valo            2013-06-12  2568   status->freq = 
ieee80211_channel_to_frequency(channel, status->band);
5e3dd157d7e70f Kalle Valo            2013-06-12 @2569   status->signal = snr + 
ATH10K_DEFAULT_NOISE_FLOOR;
7005eafc1f1cb0 Wen Gong              2019-11-14  2570  
7005eafc1f1cb0 Wen Gong              2019-11-14  2571   
BUILD_BUG_ON(ARRAY_SIZE(status->chain_signal) != ARRAY_SIZE(arg.rssi));
7005eafc1f1cb0 Wen Gong              2019-11-14  2572  
7005eafc1f1cb0 Wen Gong              2019-11-14  2573   for (i = 0; i < 
ARRAY_SIZE(status->chain_signal); i++) {
7005eafc1f1cb0 Wen Gong              2019-11-14  2574           status->chains 
&= ~BIT(i);
7005eafc1f1cb0 Wen Gong              2019-11-14  2575           rssi = 
__le32_to_cpu(arg.rssi[i]);
7005eafc1f1cb0 Wen Gong              2019-11-14  2576           ath10k_dbg(ar, 
ATH10K_DBG_MGMT, "mgmt rssi[%d]:%d\n", i, arg.rssi[i]);
7005eafc1f1cb0 Wen Gong              2019-11-14  2577  
7005eafc1f1cb0 Wen Gong              2019-11-14  2578           if (rssi != 
ATH10K_INVALID_RSSI && rssi != 0) {
7005eafc1f1cb0 Wen Gong              2019-11-14  2579                   
status->chain_signal[i] = ATH10K_DEFAULT_NOISE_FLOOR + rssi;
7005eafc1f1cb0 Wen Gong              2019-11-14  2580                   
status->chains |= BIT(i);
7005eafc1f1cb0 Wen Gong              2019-11-14  2581           }
7005eafc1f1cb0 Wen Gong              2019-11-14  2582   }
7005eafc1f1cb0 Wen Gong              2019-11-14  2583  
01cebe1c50d43a Michal Kazior         2015-03-30  2584   status->rate_idx = 
ath10k_mac_bitrate_to_idx(sband, rate / 100);
5e3dd157d7e70f Kalle Valo            2013-06-12  2585  
5e3dd157d7e70f Kalle Valo            2013-06-12  2586   hdr = (struct 
ieee80211_hdr *)skb->data;
5e3dd157d7e70f Kalle Valo            2013-06-12  2587   fc = 
le16_to_cpu(hdr->frame_control);
5e3dd157d7e70f Kalle Valo            2013-06-12  2588  
60549cab2ea5ff Grzegorz Bajorski     2015-11-30  2589   /* Firmware is 
guaranteed to report all essential management frames via
60549cab2ea5ff Grzegorz Bajorski     2015-11-30  2590    * WMI while it can 
deliver some extra via HTT. Since there can be
60549cab2ea5ff Grzegorz Bajorski     2015-11-30  2591    * duplicates split the 
reporting wrt monitor/sniffing.
60549cab2ea5ff Grzegorz Bajorski     2015-11-30  2592    */
60549cab2ea5ff Grzegorz Bajorski     2015-11-30  2593   status->flag |= 
RX_FLAG_SKIP_MONITOR;
60549cab2ea5ff Grzegorz Bajorski     2015-11-30  2594  
504f6cdf4ac3df Sujith Manoharan      2014-11-25  2595   
ath10k_wmi_handle_wep_reauth(ar, skb, status);
504f6cdf4ac3df Sujith Manoharan      2014-11-25  2596  
7d42298eb43d27 Rajkumar Manoharan    2016-08-09  2597   if 
(ath10k_wmi_rx_is_decrypted(ar, hdr)) {
eeab266c0f3c9c Marek Kwaczynski      2014-05-14  2598           status->flag |= 
RX_FLAG_DECRYPTED;
eeab266c0f3c9c Marek Kwaczynski      2014-05-14  2599  
eeab266c0f3c9c Marek Kwaczynski      2014-05-14  2600           if 
(!ieee80211_is_action(hdr->frame_control) &&
eeab266c0f3c9c Marek Kwaczynski      2014-05-14  2601               
!ieee80211_is_deauth(hdr->frame_control) &&
eeab266c0f3c9c Marek Kwaczynski      2014-05-14  2602               
!ieee80211_is_disassoc(hdr->frame_control)) {
eeab266c0f3c9c Marek Kwaczynski      2014-05-14  2603                   
status->flag |= RX_FLAG_IV_STRIPPED |
5e3dd157d7e70f Kalle Valo            2013-06-12  2604                           
        RX_FLAG_MMIC_STRIPPED;
5e3dd157d7e70f Kalle Valo            2013-06-12  2605                   
hdr->frame_control = __cpu_to_le16(fc &
5e3dd157d7e70f Kalle Valo            2013-06-12  2606                           
        ~IEEE80211_FCTL_PROTECTED);
5e3dd157d7e70f Kalle Valo            2013-06-12  2607           }
eeab266c0f3c9c Marek Kwaczynski      2014-05-14  2608   }
5e3dd157d7e70f Kalle Valo            2013-06-12  2609  
cc9904e694fa3b Michal Kazior         2015-03-10  2610   if 
(ieee80211_is_beacon(hdr->frame_control))
cc9904e694fa3b Michal Kazior         2015-03-10  2611           
ath10k_mac_handle_beacon(ar, skb);
cc9904e694fa3b Michal Kazior         2015-03-10  2612  
7aa7a72a23679a Michal Kazior         2014-08-25  2613   ath10k_dbg(ar, 
ATH10K_DBG_MGMT,
75b34800a228b5 Maharaja Kennadyrajan 2016-08-04  2614              "event mgmt 
rx skb %pK len %d ftype %02x stype %02x\n",
5e3dd157d7e70f Kalle Valo            2013-06-12  2615              skb, 
skb->len,
5e3dd157d7e70f Kalle Valo            2013-06-12  2616              fc & 
IEEE80211_FCTL_FTYPE, fc & IEEE80211_FCTL_STYPE);
5e3dd157d7e70f Kalle Valo            2013-06-12  2617  
7aa7a72a23679a Michal Kazior         2014-08-25  2618   ath10k_dbg(ar, 
ATH10K_DBG_MGMT,
5e3dd157d7e70f Kalle Valo            2013-06-12  2619              "event mgmt 
rx freq %d band %d snr %d, rate_idx %d\n",
5e3dd157d7e70f Kalle Valo            2013-06-12  2620              
status->freq, status->band, status->signal,
5e3dd157d7e70f Kalle Valo            2013-06-12  2621              
status->rate_idx);
5e3dd157d7e70f Kalle Valo            2013-06-12  2622  
37f62c0d5822f6 Erik Stromdahl        2018-09-04  2623   ieee80211_rx_ni(ar->hw, 
skb);
37f62c0d5822f6 Erik Stromdahl        2018-09-04  2624  
5e3dd157d7e70f Kalle Valo            2013-06-12  2625   return 0;
5e3dd157d7e70f Kalle Valo            2013-06-12  2626  }
5e3dd157d7e70f Kalle Valo            2013-06-12  2627  

:::::: The code at line 2569 was first introduced by commit
:::::: 5e3dd157d7e70f0e3cea3f2573ed69fb156a19d5 ath10k: mac80211 driver for 
Qualcomm Atheros 802.11ac CQA98xx devices

:::::: TO: Kalle Valo <[email protected]>
:::::: CC: Kalle Valo <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to