drivers/net/wireless/ath/ath12k/dp_mon.c:1244:24-34: Unneeded variable: "hal_status". Return " HAL_RX_MON_STATUS_BUF_DONE" on line 1260

From: kernel test robot
Date: Mon Dec 18 2023 - 11:08:43 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ceb6a6f023fd3e8b07761ed900352ef574010bcb
commit: d889913205cf7ebda905b1e62c5867ed4e39f6c2 wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices
date: 1 year, 1 month ago
config: csky-randconfig-r053-20231218 (https://download.01.org/0day-ci/archive/20231218/202312182311.pZjA9dgQ-lkp@xxxxxxxxx/config)
compiler: csky-linux-gcc (GCC) 13.2.0

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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312182311.pZjA9dgQ-lkp@xxxxxxxxx/

cocci warnings: (new ones prefixed by >>)
>> drivers/net/wireless/ath/ath12k/dp_mon.c:1244:24-34: Unneeded variable: "hal_status". Return " HAL_RX_MON_STATUS_BUF_DONE" on line 1260
--
>> drivers/net/wireless/ath/ath12k/dp_rx.c:3866:3-6: ERROR: invalid reference to the index variable of the iterator on line 3856
drivers/net/wireless/ath/ath12k/dp_rx.c:3866:29-32: ERROR: invalid reference to the index variable of the iterator on line 3856
--
>> drivers/net/wireless/ath/ath12k/wmi.c:6517:30-35: ERROR: invalid reference to the index variable of the iterator on line 6499

vim +1244 drivers/net/wireless/ath/ath12k/dp_mon.c

1231
1232 enum hal_rx_mon_status
1233 ath12k_dp_mon_rx_parse_mon_status(struct ath12k *ar,
1234 struct ath12k_mon_data *pmon,
1235 int mac_id,
1236 struct sk_buff *skb,
1237 struct napi_struct *napi)
1238 {
1239 struct ath12k_base *ab = ar->ab;
1240 struct hal_rx_mon_ppdu_info *ppdu_info = &pmon->mon_ppdu_info;
1241 struct dp_mon_mpdu *tmp;
1242 struct dp_mon_mpdu *mon_mpdu = pmon->mon_mpdu;
1243 struct sk_buff *head_msdu, *tail_msdu;
> 1244 enum hal_rx_mon_status hal_status = HAL_RX_MON_STATUS_BUF_DONE;
1245
1246 ath12k_dp_mon_parse_rx_dest(ab, pmon, skb);
1247
1248 list_for_each_entry_safe(mon_mpdu, tmp, &pmon->dp_rx_mon_mpdu_list, list) {
1249 list_del(&mon_mpdu->list);
1250 head_msdu = mon_mpdu->head;
1251 tail_msdu = mon_mpdu->tail;
1252
1253 if (head_msdu && tail_msdu) {
1254 ath12k_dp_mon_rx_deliver(ar, mac_id, head_msdu,
1255 ppdu_info, napi);
1256 }
1257
1258 kfree(mon_mpdu);
1259 }
> 1260 return hal_status;
1261 }
1262

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki