Explorar el Código

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
Dustin Brown hace 7 años
padre
commit
d3a53dbc06

+ 2 - 2
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) {

+ 12 - 2
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 */

+ 2 - 2
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) {

+ 2 - 2
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) {