ソースを参照

qcacmn: Remove error log for qdf_mem_malloc in wmi files

qdf layer already has the error trace

Change-Id: I4c63264f6674c6c2710368de4b5c9f24817ac74c
CRs-Fixed: 2376431
Madhvapathi Sriram 6 年 前
コミット
610c0c8e41
4 ファイル変更140 行追加288 行削除
  1. 23 36
      wmi/src/wmi_unified.c
  2. 1 3
      wmi/src/wmi_unified_nan_tlv.c
  3. 3 5
      wmi/src/wmi_unified_ocb_ut.c
  4. 113 244
      wmi/src/wmi_unified_tlv.c

+ 23 - 36
wmi/src/wmi_unified.c

@@ -712,10 +712,9 @@ static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle)
 		wmi_log_max_entry * sizeof(struct wmi_command_debug));
 	cmd_log_buf->size = wmi_log_max_entry;
 
-	if (!cmd_log_buf->buf) {
-		WMI_LOGE("no memory for WMI command log buffer..");
+	if (!cmd_log_buf->buf)
 		return QDF_STATUS_E_NOMEM;
-	}
+
 	cmd_log_buf->p_buf_tail_idx = &cmd_log_buf->buf_tail_idx;
 
 	/* WMI commands TX completed */
@@ -725,10 +724,9 @@ static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle)
 		wmi_log_max_entry * sizeof(struct wmi_command_debug));
 	cmd_tx_cmpl_log_buf->size = wmi_log_max_entry;
 
-	if (!cmd_tx_cmpl_log_buf->buf) {
-		WMI_LOGE("no memory for WMI Command Tx Complete log buffer..");
+	if (!cmd_tx_cmpl_log_buf->buf)
 		return QDF_STATUS_E_NOMEM;
-	}
+
 	cmd_tx_cmpl_log_buf->p_buf_tail_idx =
 		&cmd_tx_cmpl_log_buf->buf_tail_idx;
 
@@ -739,10 +737,9 @@ static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle)
 		wmi_log_max_entry * sizeof(struct wmi_event_debug));
 	event_log_buf->size = wmi_log_max_entry;
 
-	if (!event_log_buf->buf) {
-		WMI_LOGE("no memory for WMI Event log buffer..");
+	if (!event_log_buf->buf)
 		return QDF_STATUS_E_NOMEM;
-	}
+
 	event_log_buf->p_buf_tail_idx = &event_log_buf->buf_tail_idx;
 
 	/* WMI events when queued */
@@ -752,10 +749,9 @@ static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle)
 		wmi_log_max_entry * sizeof(struct wmi_event_debug));
 	rx_event_log_buf->size = wmi_log_max_entry;
 
-	if (!rx_event_log_buf->buf) {
-		WMI_LOGE("no memory for WMI Event Rx log buffer..");
+	if (!rx_event_log_buf->buf)
 		return QDF_STATUS_E_NOMEM;
-	}
+
 	rx_event_log_buf->p_buf_tail_idx = &rx_event_log_buf->buf_tail_idx;
 
 	/* WMI Management commands */
@@ -765,10 +761,9 @@ static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle)
 		wmi_mgmt_log_max_entry * sizeof(struct wmi_command_debug));
 	mgmt_cmd_log_buf->size = wmi_mgmt_log_max_entry;
 
-	if (!mgmt_cmd_log_buf->buf) {
-		WMI_LOGE("no memory for WMI Management Command log buffer..");
+	if (!mgmt_cmd_log_buf->buf)
 		return QDF_STATUS_E_NOMEM;
-	}
+
 	mgmt_cmd_log_buf->p_buf_tail_idx = &mgmt_cmd_log_buf->buf_tail_idx;
 
 	/* WMI Management commands Tx completed*/
@@ -780,10 +775,9 @@ static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle)
 		sizeof(struct wmi_command_debug));
 	mgmt_cmd_tx_cmp_log_buf->size = wmi_mgmt_log_max_entry;
 
-	if (!mgmt_cmd_tx_cmp_log_buf->buf) {
-		WMI_LOGE("no memory for WMI Management Command Tx complete log buffer..");
+	if (!mgmt_cmd_tx_cmp_log_buf->buf)
 		return QDF_STATUS_E_NOMEM;
-	}
+
 	mgmt_cmd_tx_cmp_log_buf->p_buf_tail_idx =
 		&mgmt_cmd_tx_cmp_log_buf->buf_tail_idx;
 
@@ -796,10 +790,9 @@ static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle)
 		sizeof(struct wmi_event_debug));
 	mgmt_event_log_buf->size = wmi_mgmt_log_max_entry;
 
-	if (!mgmt_event_log_buf->buf) {
-		WMI_LOGE("no memory for WMI Management Event log buffer..");
+	if (!mgmt_event_log_buf->buf)
 		return QDF_STATUS_E_NOMEM;
-	}
+
 	mgmt_event_log_buf->p_buf_tail_idx = &mgmt_event_log_buf->buf_tail_idx;
 
 	/* WMI diag events when received */
@@ -811,10 +804,9 @@ static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle)
 		sizeof(struct wmi_event_debug));
 	diag_event_log_buf->size = wmi_diag_log_max_entry;
 
-	if (!diag_event_log_buf->buf) {
-		qdf_print("no memory for WMI diag event log buffer..\n");
+	if (!diag_event_log_buf->buf)
 		return QDF_STATUS_E_NOMEM;
-	}
+
 	diag_event_log_buf->p_buf_tail_idx = &diag_event_log_buf->buf_tail_idx;
 
 	qdf_spinlock_create(&wmi_handle->log_info.wmi_record_lock);
@@ -1575,8 +1567,10 @@ wmi_buf_t wmi_buf_alloc_fl(wmi_unified_t wmi_handle, uint32_t len,
 				WMI_MIN_HEAD_ROOM, 4), WMI_MIN_HEAD_ROOM, 4,
 				false, func, line);
 
-	if (!wmi_buf)
+	if (!wmi_buf) {
+		wmi_nofl_err("%s:%d, failed to alloc len:%d", func, line, len);
 		return NULL;
+	}
 
 	/* Clear the wmi buffer */
 	OS_MEMZERO(qdf_nbuf_data(wmi_buf), len);
@@ -2439,11 +2433,9 @@ void *wmi_unified_get_pdev_handle(struct wmi_soc *soc, uint32_t pdev_idx)
 		wmi_handle =
 			(struct wmi_unified *) qdf_mem_malloc(
 					sizeof(struct wmi_unified));
-		if (wmi_handle == NULL) {
-			WMI_LOGE("allocation of wmi handle failed %zu",
-				  sizeof(struct wmi_unified));
+		if (!wmi_handle)
 			return NULL;
-		}
+
 		wmi_handle->scn_handle = soc->scn_handle;
 		wmi_handle->event_id = soc->event_id;
 		wmi_handle->event_handler = soc->event_handler;
@@ -2552,19 +2544,14 @@ void *wmi_unified_attach(void *scn_handle,
 	struct wmi_soc *soc;
 
 	soc = (struct wmi_soc *) qdf_mem_malloc(sizeof(struct wmi_soc));
-	if (soc == NULL) {
-		WMI_LOGE("Allocation of wmi_soc failed %zu",
-			  sizeof(struct wmi_soc));
+	if (!soc)
 		return NULL;
-	}
 
 	wmi_handle =
 		(struct wmi_unified *) qdf_mem_malloc(
 			sizeof(struct wmi_unified));
-	if (wmi_handle == NULL) {
+	if (!wmi_handle) {
 		qdf_mem_free(soc);
-		WMI_LOGE("allocation of wmi handle failed %zu",
-			  sizeof(struct wmi_unified));
 		return NULL;
 	}
 	wmi_handle->soc = soc;

+ 1 - 3
wmi/src/wmi_unified_nan_tlv.c

@@ -999,10 +999,8 @@ static QDF_STATUS extract_ndp_end_ind_tlv(wmi_unified_t wmi_handle,
 	buf_size = sizeof(**rsp) + event->num_ndp_end_indication_list *
 			sizeof((*rsp)->ndp_map[0]);
 	*rsp = qdf_mem_malloc(buf_size);
-	if (!(*rsp)) {
-		WMI_LOGE("Failed to allocate memory");
+	if (!(*rsp))
 		return QDF_STATUS_E_NOMEM;
-	}
 
 	(*rsp)->num_ndp_ids = event->num_ndp_end_indication_list;
 	for (i = 0; i < (*rsp)->num_ndp_ids; i++) {

+ 3 - 5
wmi/src/wmi_unified_ocb_ut.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -229,11 +229,9 @@ static QDF_STATUS fake_dcc_update_ndl_cmd_tlv(wmi_unified_t wmi_handle,
 	WMI_LOGP("%s : called", __func__);
 	/* Allocate and populate the response */
 	resp = qdf_mem_malloc(sizeof(*resp));
-	if (!resp) {
-		WMI_LOGP("%s:Error allocating memory for the response.",
-			__func__);
+	if (!resp)
 		return -ENOMEM;
-	}
+
 	resp->vdev_id = update_ndl_param->vdev_id;
 	resp->status = 0;
 

ファイルの差分が大きいため隠しています
+ 113 - 244
wmi/src/wmi_unified_tlv.c


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません