summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandrasekaran, Manishekar <cmshekar@qti.qualcomm.com>2014-01-29 23:38:34 +0530
committerPrakash Dhavali <pdhavali@qca.qualcomm.com>2014-01-31 17:28:11 -0800
commit67c03aa508fec9c689cf76649e4de0a0b397ea1f (patch)
treec8c9f00be77e1e5b5aaba0dce4e466cb54cd5ae4
parent9b0c8b8041f1746fdb9b3daad2ab5ed0c0695be7 (diff)
qcacld: Fix for new static source analysis errors in WMA module
Running static source analysis on WMA module generates quite a few errors/warnings. This fix will help to remove those errors and warnings Change-Id: I0db9f17e2635401073a42f4e2de6679eec0a8457 CRs-Fixed: 608831
-rw-r--r--CORE/SERVICES/WMA/wma.c41
1 files changed, 27 insertions, 14 deletions
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index fd8dac1ae4f9..3044440246cd 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -13763,7 +13763,7 @@ VOS_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
curr_pdev = vos_get_context(VOS_MODULE_ID_TXRX, wma->vos_context);
if (NULL == curr_pdev) {
- WMA_LOGE("TM Invalid pdev");
+ WMA_LOGE("%s: Failed to get pdev", __func__);
return VOS_STATUS_E_FAILURE;
}
@@ -13823,6 +13823,10 @@ VOS_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
{
WMA_LOGE("Could not send thermal mgmt command to the firmware!");
}
+ }
+ return VOS_STATUS_SUCCESS;
+}
+
/* function : wma_process_set_thermal_level
* Descriptin : This function set the new thermal throttle level in the
@@ -13838,18 +13842,20 @@ VOS_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
u_int8_t *pThermalLevel)
{
t_thermal_cmd_params thermal_params;
- u_int8_t thermal_level = (*pThermalLevel);
+ u_int8_t thermal_level;
ol_txrx_pdev_handle curr_pdev;
- if (NULL == wma || NULL == pThermalLevel) {
- WMA_LOGE("TM Invalid input");
- return VOS_STATUS_E_FAILURE;
- }
- curr_pdev = vos_get_context(VOS_MODULE_ID_TXRX, wma->vos_context);
+ if (NULL == wma || NULL == pThermalLevel) {
+ WMA_LOGE("TM Invalid input");
+ return VOS_STATUS_E_FAILURE;
+ }
+
+ thermal_level = (*pThermalLevel);
+ curr_pdev = vos_get_context(VOS_MODULE_ID_TXRX, wma->vos_context);
if (NULL == curr_pdev) {
- WMA_LOGE("TM Invalid pdev");
+ WMA_LOGE("%s: Failed to get pdev", __func__);
return VOS_STATUS_E_FAILURE;
}
@@ -14891,23 +14897,30 @@ u_int8_t wma_thermal_mgmt_get_level(void *handle, u_int32_t temp)
static int wma_thermal_mgmt_evt_handler(void *handle, u_int8_t *event,
u_int32_t len)
{
- tp_wma_handle wma = (tp_wma_handle) handle;
+ tp_wma_handle wma;
wmi_thermal_mgmt_event_fixed_param *tm_event;
u_int8_t thermal_level;
t_thermal_cmd_params thermal_params;
- WMI_THERMAL_MGMT_EVENTID_param_tlvs *param_buf =
- (WMI_THERMAL_MGMT_EVENTID_param_tlvs *) event;
+ WMI_THERMAL_MGMT_EVENTID_param_tlvs *param_buf;
ol_txrx_pdev_handle curr_pdev;
if (NULL == event || NULL == handle) {
- WMA_LOGE("Invalid thermal mitigation event buffer");
+ WMA_LOGE("Invalid thermal mitigation event buffer");
+ return -EINVAL;
+ }
+
+ wma = (tp_wma_handle) handle;
+
+ if (NULL == wma) {
+ WMA_LOGE("%s: Failed to get wma handle", __func__);
return -EINVAL;
}
- curr_pdev = vos_get_context(VOS_MODULE_ID_TXRX, wma->vos_context);
+ param_buf = (WMI_THERMAL_MGMT_EVENTID_param_tlvs *) event;
+ curr_pdev = vos_get_context(VOS_MODULE_ID_TXRX, wma->vos_context);
if (NULL == curr_pdev) {
- WMA_LOGE("Invalid pdev");
+ WMA_LOGE("%s: Failed to get pdev", __func__);
return -EINVAL;
}