Browse Source

qcacmn: Remove redundant qdf_mem_zero calls

qcacmn to qcacmn-2.0 propagation

qdf_mem_zero is called after qdf_mem_malloc to set the memory
value to zero. qdf_mem_malloc uses kzalloc internally to allocate
memory which sets memory to zero.

Removing redundant qdf_mem_zero which are called after
qdf_mem_malloc.

Change-Id: I8e1faf6099f8fbc869c8af42b7511a13e66e6bed
CRs-Fixed: 1079697
yeshwanth sriram guntuka 8 years ago
parent
commit
78ee68fa4a

+ 1 - 4
hif/src/ce/ce_main.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -668,8 +668,6 @@ static struct CE_ring_state *ce_alloc_ring_state(struct CE_state *CE_state,
 	if (!ptr)
 		return NULL;
 
-	qdf_mem_zero(ptr, ce_nbytes);
-
 	ce_ring = (struct CE_ring_state *)ptr;
 	ptr += sizeof(struct CE_ring_state);
 	ce_ring->nentries = nentries;
@@ -767,7 +765,6 @@ struct CE_handle *ce_init(struct hif_softc *scn,
 			return NULL;
 		}
 		malloc_CE_state = true;
-		qdf_mem_zero(CE_state, sizeof(*CE_state));
 		scn->ce_id_to_state[CE_id] = CE_state;
 		qdf_spinlock_create(&CE_state->ce_index_lock);
 

+ 1 - 3
hif/src/hif_main.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -415,8 +415,6 @@ struct hif_opaque_softc *hif_open(qdf_device_t qdf_ctx, uint32_t mode,
 		return GET_HIF_OPAQUE_HDL(scn);
 	}
 
-	qdf_mem_zero(scn, bus_context_size);
-
 	scn->qdf_dev = qdf_ctx;
 	scn->hif_con_param = mode;
 	qdf_atomic_init(&scn->active_tasklet_cnt);

+ 1 - 2
hif/src/sdio/hif_sdio_dev.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -231,7 +231,6 @@ struct hif_sdio_device *hif_dev_create(struct hif_sdio_dev *hif_device,
 		return NULL;
 	}
 
-	qdf_mem_zero(pdev, sizeof(struct hif_sdio_device));
 	qdf_spinlock_create(&pdev->Lock);
 	qdf_spinlock_create(&pdev->TxLock);
 	qdf_spinlock_create(&pdev->RxLock);

+ 1 - 2
hif/src/sdio/if_sdio.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -93,7 +93,6 @@ static A_STATUS hif_sdio_probe(void *context, void *hif_handle)
 		ret = -ENOMEM;
 		goto err_alloc;
 	}
-	qdf_mem_zero(scn, sizeof(*scn));
 
 	scn->hif_handle = hif_handle;
 	hif_configure_device(hif_handle, HIF_DEVICE_GET_OS_DEVICE,

+ 1 - 2
hif/src/sdio/native_sdio/src/hif.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -2550,7 +2550,6 @@ static struct hif_sdio_dev *add_hif_device(struct sdio_func *func)
 	hifdevice = (struct hif_sdio_dev *) qdf_mem_malloc(sizeof(
 							struct hif_sdio_dev));
 	AR_DEBUG_ASSERT(hifdevice != NULL);
-	qdf_mem_zero(hifdevice, sizeof(*hifdevice));
 #if HIF_USE_DMA_BOUNCE_BUFFER
 	hifdevice->dma_buffer = qdf_mem_malloc(HIF_DMA_BUFFER_SIZE);
 	AR_DEBUG_ASSERT(hifdevice->dma_buffer != NULL);

+ 1 - 6
hif/src/sdio/native_sdio/src/hif_scatter.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -377,8 +377,6 @@ QDF_STATUS setup_hif_scatter_support(struct hif_sdio_dev *device,
 					struct HIF_SCATTER_REQ_PRIV));
 		if (NULL == req_priv)
 			goto end;
-		qdf_mem_zero(req_priv, sizeof(
-					struct HIF_SCATTER_REQ_PRIV));
 		/* save the device instance */
 		req_priv->device = device;
 		/* allocate the scatter request */
@@ -392,9 +390,6 @@ QDF_STATUS setup_hif_scatter_support(struct hif_sdio_dev *device,
 			qdf_mem_free(req_priv);
 			goto end;
 		}
-		/* just zero the main part of the scatter request */
-		qdf_mem_zero(req_priv->hif_scatter_req,
-			     sizeof(struct _HIF_SCATTER_REQ));
 		/* back pointer to the private struct */
 		req_priv->hif_scatter_req->hif_private[0] = req_priv;
 		/* allocate a bus request for this scatter request */

+ 0 - 4
htc/htc.c

@@ -79,7 +79,6 @@ static HTC_PACKET *build_htc_tx_ctrl_packet(qdf_device_t osdev)
 		if (NULL == pPacket) {
 			break;
 		}
-		qdf_mem_zero(pPacket, sizeof(HTC_PACKET));
 		netbuf = qdf_nbuf_alloc(osdev, HTC_CONTROL_BUFFER_SIZE,
 					20, 4, true);
 		if (NULL == netbuf) {
@@ -261,8 +260,6 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, qdf_device_t osdev,
 		return NULL;
 	}
 
-	qdf_mem_zero(target, sizeof(HTC_TARGET));
-
 	htc_runtime_pm_init(target);
 	qdf_spinlock_create(&target->HTCLock);
 	qdf_spinlock_create(&target->HTCRxLock);
@@ -285,7 +282,6 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, qdf_device_t osdev,
 			HTC_PACKET *pPacket =
 				(HTC_PACKET *) qdf_mem_malloc(sizeof(HTC_PACKET));
 			if (pPacket != NULL) {
-				qdf_mem_zero(pPacket, sizeof(HTC_PACKET));
 				free_htc_packet_container(target, pPacket);
 			}
 		}