Bläddra i källkod

qcacld-3.0: os_if: Remove logs for qdf_mem_malloc() checks

qdf_mem_malloc() function already takes care of logging the
caller function name and line number in case of any allocation error.
Hence there is no need to add the error log again.

Getting rid of these unnecessary logs reduces driver memory footprint.

Change-Id: I6a29180db4bd55385da4c79f793b2d9ff3c9cfb8
CRs-Fixed: 2781932
Srinivas Girigowda 4 år sedan
förälder
incheckning
78824d97ff
2 ändrade filer med 10 tillägg och 19 borttagningar
  1. 5 10
      os_if/nan/src/os_if_nan.c
  2. 5 9
      os_if/tdls/src/wlan_cfg80211_tdls.c

+ 5 - 10
os_if/nan/src/os_if_nan.c

@@ -1759,10 +1759,9 @@ static void os_if_ndp_end_ind_handler(struct wlan_objmgr_vdev *vdev,
 
 	ndp_instance_array = qdf_mem_malloc(end_ind->num_ndp_ids *
 		sizeof(*ndp_instance_array));
-	if (!ndp_instance_array) {
-		osif_err("Failed to allocate ndp_instance_array");
+	if (!ndp_instance_array)
 		return;
-	}
+
 	for (i = 0; i < end_ind->num_ndp_ids; i++)
 		ndp_instance_array[i] = end_ind->ndp_map[i].ndp_instance_id;
 
@@ -2502,10 +2501,8 @@ static int os_if_nan_generic_req(struct wlan_objmgr_psoc *psoc,
 	buf_len = nla_len(tb[QCA_WLAN_VENDOR_ATTR_NAN_CMD_DATA]);
 
 	nan_req = qdf_mem_malloc(sizeof(*nan_req) +  buf_len);
-	if (!nan_req) {
-		osif_err("Request allocation failure");
+	if (!nan_req)
 		return -ENOMEM;
-	}
 
 	nan_req->psoc = psoc;
 	nan_req->params.request_data_len = buf_len;
@@ -2568,11 +2565,9 @@ static int os_if_process_nan_enable_req(struct wlan_objmgr_psoc *psoc,
 	buf_len = nla_len(tb[QCA_WLAN_VENDOR_ATTR_NAN_CMD_DATA]);
 
 	nan_req = qdf_mem_malloc(sizeof(*nan_req) + buf_len);
-
-	if (!nan_req) {
-		osif_err("Request allocation failure");
+	if (!nan_req)
 		return -ENOMEM;
-	}
+
 	nan_req->social_chan_2g_freq = chan_freq_2g;
 	if (chan_freq_5g)
 		nan_req->social_chan_5g_freq = chan_freq_5g;

+ 5 - 9
os_if/tdls/src/wlan_cfg80211_tdls.c

@@ -66,10 +66,9 @@ QDF_STATUS wlan_cfg80211_tdls_osif_priv_init(struct wlan_objmgr_vdev *vdev)
 
 	osif_debug("initialize tdls os if layer private structure");
 	tdls_priv = qdf_mem_malloc(sizeof(*tdls_priv));
-	if (!tdls_priv) {
-		osif_err("failed to allocate memory for tdls_priv");
+	if (!tdls_priv)
 		return QDF_STATUS_E_NOMEM;
-	}
+
 	init_completion(&tdls_priv->tdls_add_peer_comp);
 	init_completion(&tdls_priv->tdls_del_peer_comp);
 	init_completion(&tdls_priv->tdls_mgmt_comp);
@@ -222,10 +221,8 @@ int wlan_cfg80211_tdls_add_peer(struct wlan_objmgr_vdev *vdev,
 		   QDF_MAC_ADDR_REF(mac));
 
 	add_peer_req = qdf_mem_malloc(sizeof(*add_peer_req));
-	if (!add_peer_req) {
-		osif_err("Failed to allocate tdls add peer request mem");
+	if (!add_peer_req)
 		return -EINVAL;
-	}
 
 	osif_priv = wlan_vdev_get_ospriv(vdev);
 	if (!osif_priv || !osif_priv->osif_tdls) {
@@ -443,10 +440,9 @@ int wlan_cfg80211_tdls_update_peer(struct wlan_objmgr_vdev *vdev,
 		   QDF_MAC_ADDR_REF(mac));
 
 	req_info = qdf_mem_malloc(sizeof(*req_info));
-	if (!req_info) {
-		osif_err("Failed to allocate tdls add peer request mem");
+	if (!req_info)
 		return -EINVAL;
-	}
+
 	wlan_cfg80211_tdls_extract_params(req_info, params);
 
 	osif_priv = wlan_vdev_get_ospriv(vdev);