diff mbox series

[3/3] ath11k: workaround GCC unitialised warnings

Message ID 1557811234-5439-3-git-send-email-kvalo@codeaurora.org (mailing list archive)
State Accepted
Commit e8cb49bd3900e46daa66f7c6c75ca6dad7a03773
Delegated to: Kalle Valo
Headers show
Series [1/3] ath11k: fix sparse symbol should be static warnings | expand

Commit Message

Kalle Valo May 14, 2019, 5:20 a.m. UTC
After making some WMI functions static GCC started to warn quite a lot about
uninitalised variables:

ath11k/wmi.c:5303:3: warning: 'install_key_compl.status' may be used uninitialized in this function [-Wmaybe-uninitialized]

From a quick look they look like false warnings but let's initialise the
variables anyway to make the warning go away.

Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/wmi.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 7ca0a64befb4..9a0b904a16ff 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -4805,7 +4805,7 @@  static void ath11k_bcn_tx_status_event(struct ath11k_base *ab, u8 *evt_buf, u32
 static void ath11k_vdev_stopped_event(struct ath11k_base *ab, u8 *evt_buf, u32 len)
 {
 	struct ath11k *ar;
-	u32 vdev_id;
+	u32 vdev_id = 0;
 
 	if (ath11k_pull_vdev_stopped_param_tlv(ab, evt_buf, len,
 					       &vdev_id) != 0) {
@@ -4831,7 +4831,7 @@  static void ath11k_vdev_stopped_event(struct ath11k_base *ab, u8 *evt_buf, u32 l
 
 static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)
 {
-	struct mgmt_rx_event_params rx_ev;
+	struct mgmt_rx_event_params rx_ev = {0};
 	struct ath11k *ar;
 	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
 	struct ieee80211_hdr *hdr;
@@ -4940,7 +4940,7 @@  static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)
 
 static void ath11k_mgmt_tx_compl_event(struct ath11k_base *ab, struct sk_buff *skb)
 {
-	struct wmi_mgmt_tx_compl_event tx_compl_param;
+	struct wmi_mgmt_tx_compl_event tx_compl_param = {0};
 	struct ath11k *ar;
 
 	if (ath11k_pull_mgmt_tx_compl_param_tlv(ab, skb->data, skb->len,
@@ -4972,7 +4972,7 @@  static void ath11k_mgmt_tx_compl_event(struct ath11k_base *ab, struct sk_buff *s
 static void ath11k_scan_event(struct ath11k_base *ab, u8 *evt_buf, u32 len)
 {
 	struct ath11k *ar;
-	struct wmi_scan_event scan_ev;
+	struct wmi_scan_event scan_ev = {0};
 
 	if (ath11k_pull_scan_ev(ab, evt_buf, len,
 				&scan_ev) != 0) {
@@ -5079,7 +5079,7 @@  static void ath11k_peer_sta_kickout_event(struct ath11k_base *ab, u8 *evt_buf, u
 
 static void ath11k_roam_event(struct ath11k_base *ab, u8 *evt_buf, u32 len)
 {
-	struct wmi_roam_event roam_ev;
+	struct wmi_roam_event roam_ev = {};
 	struct ath11k *ar;
 
 	if (ath11k_pull_roam_ev(ab, evt_buf, len, &roam_ev) != 0) {
@@ -5125,7 +5125,7 @@  static void ath11k_roam_event(struct ath11k_base *ab, u8 *evt_buf, u32 len)
 
 static void ath11k_chan_info_event(struct ath11k_base *ab, u8 *evt_buf, u32 len)
 {
-	struct wmi_chan_info_event ch_info_ev;
+	struct wmi_chan_info_event ch_info_ev = {0};
 	struct ath11k *ar;
 	struct survey_info *survey;
 	int idx;
@@ -5199,7 +5199,7 @@  static void ath11k_chan_info_event(struct ath11k_base *ab, u8 *evt_buf, u32 len)
 static void ath11k_pdev_bss_chan_info_event(struct ath11k_base *ab, u8 *evt_buf,
 				     u32 len)
 {
-	struct wmi_pdev_bss_chan_info_event bss_ch_info_ev;
+	struct wmi_pdev_bss_chan_info_event bss_ch_info_ev = {};
 	struct survey_info *survey;
 	struct ath11k *ar;
 	u32 cc_freq_hz = ab->cc_freq_hz;
@@ -5273,7 +5273,7 @@  static void ath11k_pdev_bss_chan_info_event(struct ath11k_base *ab, u8 *evt_buf,
 static void ath11k_vdev_install_key_compl_event(struct ath11k_base *ab, u8 *evt_buf,
 						u32 len)
 {
-	struct wmi_vdev_install_key_complete_arg install_key_compl;
+	struct wmi_vdev_install_key_complete_arg install_key_compl = {0};
 	struct ath11k *ar;
 
 	if (ath11k_pull_vdev_install_key_compl_ev(ab, evt_buf, len,
@@ -5347,7 +5347,7 @@  static void ath11k_service_available_event(struct ath11k_base *ab, u8 *evt_buf,
 
 static void ath11k_peer_assoc_conf_event(struct ath11k_base *ab, u8 *evt_buf, u32 len)
 {
-	struct wmi_peer_assoc_conf_arg peer_assoc_conf;
+	struct wmi_peer_assoc_conf_arg peer_assoc_conf = {0};
 	struct ath11k *ar;
 
 	if (ath11k_pull_peer_assoc_conf_ev(ab, evt_buf, len,