All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: ath11k@lists.infradead.org
Subject: [PATCH 3/3] ath11k: workaround GCC unitialised warnings
Date: Tue, 14 May 2019 08:20:34 +0300	[thread overview]
Message-ID: <1557811234-5439-3-git-send-email-kvalo@codeaurora.org> (raw)
In-Reply-To: <1557811234-5439-1-git-send-email-kvalo@codeaurora.org>

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 --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,
-- 
2.7.4


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  parent reply	other threads:[~2019-05-14  5:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14  5:20 [PATCH 1/3] ath11k: fix sparse symbol should be static warnings Kalle Valo
2019-05-14  5:20 ` [PATCH 2/3] ath11k: remove unused functions Kalle Valo
2019-05-14  5:20 ` Kalle Valo [this message]
2019-05-20  8:26 ` [PATCH 1/3] ath11k: fix sparse symbol should be static warnings Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1557811234-5439-3-git-send-email-kvalo@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.