From d3a53dbc06353020a1bf0a7a8d19dbfac404f3fd Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Mon, 5 Mar 2018 13:54:29 -0800 Subject: [PATCH] qcacld-3.0: Fix PERF build issue in PMO Building CLD3.2 with a performance configuration results in several "potentially uninitialized" warnings. Initialize the relevant variables to avoid the warnings. Change-Id: If97b67d50ebe2b7465fd2cc5a6a44488e4cb25a7 CRs-Fixed: 2200294 --- components/pmo/core/inc/wlan_pmo_main.h | 4 ++-- components/pmo/core/inc/wlan_pmo_objmgr.h | 14 ++++++++++++-- components/pmo/core/inc/wlan_pmo_suspend_resume.h | 4 ++-- components/pmo/core/src/wlan_pmo_main.c | 4 ++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/components/pmo/core/inc/wlan_pmo_main.h b/components/pmo/core/inc/wlan_pmo_main.h index 0137d0aa03..a8157254d8 100644 --- a/components/pmo/core/inc/wlan_pmo_main.h +++ b/components/pmo/core/inc/wlan_pmo_main.h @@ -215,7 +215,7 @@ pmo_core_psoc_update_dp_handle(struct wlan_objmgr_psoc *psoc, void *dp_hdl) */ static inline void *pmo_core_psoc_get_dp_handle(struct wlan_objmgr_psoc *psoc) { - void *dp_hdl; + void *dp_hdl = NULL; struct pmo_psoc_priv_obj *psoc_ctx; pmo_psoc_with_ctx(psoc, psoc_ctx) { @@ -289,7 +289,7 @@ pmo_core_psoc_update_htc_handle(struct wlan_objmgr_psoc *psoc, void *htc_hdl) */ static inline void *pmo_core_psoc_get_htc_handle(struct wlan_objmgr_psoc *psoc) { - void *htc_hdl; + void *htc_hdl = NULL; struct pmo_psoc_priv_obj *psoc_ctx; pmo_psoc_with_ctx(psoc, psoc_ctx) { diff --git a/components/pmo/core/inc/wlan_pmo_objmgr.h b/components/pmo/core/inc/wlan_pmo_objmgr.h index 61faaa0128..26ef1e052b 100644 --- a/components/pmo/core/inc/wlan_pmo_objmgr.h +++ b/components/pmo/core/inc/wlan_pmo_objmgr.h @@ -143,9 +143,19 @@ pmo_psoc_get_priv(struct wlan_objmgr_psoc *psoc) return psoc_priv; } +static inline bool __pmo_spinlock_bh_safe(struct pmo_psoc_priv_obj *psoc_ctx) +{ + if (!psoc_ctx) + return false; + + qdf_spin_lock_bh(&psoc_ctx->lock); + + return true; +} + #define pmo_psoc_with_ctx(psoc, cursor) \ - for (cursor = pmo_psoc_get_priv(psoc), qdf_spin_lock_bh(&cursor->lock);\ - cursor; \ + for (cursor = pmo_psoc_get_priv(psoc); \ + __pmo_spinlock_bh_safe(cursor); \ qdf_spin_unlock_bh(&cursor->lock), cursor = NULL) /* Tree Navigation: pdev */ diff --git a/components/pmo/core/inc/wlan_pmo_suspend_resume.h b/components/pmo/core/inc/wlan_pmo_suspend_resume.h index ce05c7c591..343aae0f7d 100644 --- a/components/pmo/core/inc/wlan_pmo_suspend_resume.h +++ b/components/pmo/core/inc/wlan_pmo_suspend_resume.h @@ -43,7 +43,7 @@ void pmo_core_configure_dynamic_wake_events(struct wlan_objmgr_psoc *psoc); */ static inline bool pmo_core_get_wow_bus_suspend(struct wlan_objmgr_psoc *psoc) { - bool value; + bool value = false; struct pmo_psoc_priv_obj *psoc_ctx; pmo_psoc_with_ctx(psoc, psoc_ctx) { @@ -267,7 +267,7 @@ pmo_core_psoc_update_power_save_mode(struct wlan_objmgr_psoc *psoc, static inline uint8_t pmo_core_psoc_get_power_save_mode(struct wlan_objmgr_psoc *psoc) { - uint8_t value; + uint8_t value = 0; struct pmo_psoc_priv_obj *psoc_ctx; pmo_psoc_with_ctx(psoc, psoc_ctx) { diff --git a/components/pmo/core/src/wlan_pmo_main.c b/components/pmo/core/src/wlan_pmo_main.c index 659cfc8e7a..da32ba208e 100644 --- a/components/pmo/core/src/wlan_pmo_main.c +++ b/components/pmo/core/src/wlan_pmo_main.c @@ -227,7 +227,7 @@ void pmo_core_psoc_set_hif_handle(struct wlan_objmgr_psoc *psoc, void *pmo_core_psoc_get_hif_handle(struct wlan_objmgr_psoc *psoc) { - void *hif_hdl; + void *hif_hdl = NULL; struct pmo_psoc_priv_obj *psoc_ctx; pmo_psoc_with_ctx(psoc, psoc_ctx) { @@ -249,7 +249,7 @@ void pmo_core_psoc_set_txrx_handle(struct wlan_objmgr_psoc *psoc, void *pmo_core_psoc_get_txrx_handle(struct wlan_objmgr_psoc *psoc) { - void *txrx_hdl; + void *txrx_hdl = NULL; struct pmo_psoc_priv_obj *psoc_ctx; pmo_psoc_with_ctx(psoc, psoc_ctx) {