Fix uninitilized variable warnings spotted during clang compilation.
Warnings:
drivers/net/wireless/ath/ath12k/mac.c:1076:8: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
drivers/net/wireless/ath/ath12k/dbring.c:272:7: warning: variable 'ring' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
drivers/net/wireless/ath/ath12k/dp_rx.c:2690:34: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-03171-QCAHKSWPL_SILICONZ-1
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Thiraviyam Mariyappan <quic_tmariyap@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221221105529.19345-2-quic_tmariyap@quicinc.com
int ath12k_dbring_buffer_release_event(struct ath12k_base *ab,
struct ath12k_dbring_buf_release_event *ev)
{
- struct ath12k_dbring *ring;
+ struct ath12k_dbring *ring = NULL;
struct hal_srng *srng;
struct ath12k *ar;
struct ath12k_dbring_element *buff;
struct sk_buff *msdu;
bool done = false;
int mac_id;
- int i;
u64 desc_va;
__skb_queue_head_init(&msdu_list);
goto exit;
/* TODO: Move to implicit BM? */
- ath12k_dp_rx_bufs_replenish(ab, i, rx_ring, num_buffs_reaped,
+ ath12k_dp_rx_bufs_replenish(ab, 0, rx_ring, num_buffs_reaped,
ab->hw_params->hal_params->rx_buf_rbm, true);
ath12k_dp_rx_process_received_packets(ab, napi, &msdu_list,
{
struct ath12k *ar = hw->priv;
struct ieee80211_conf *conf = &hw->conf;
- int ret;
+ int ret = 0;
mutex_lock(&ar->conf_mutex);
err_mon_del:
ath12k_mac_monitor_vdev_delete(ar);
mutex_unlock(&ar->conf_mutex);
- return 0;
+ return ret;
}
static int ath12k_mac_setup_bcn_tmpl(struct ath12k_vif *arvif)