[PATCH] staging: r8822be: remove unnecessary call to memset

From: Himanshu Jha
Date: Sun Aug 27 2017 - 09:32:06 EST


call to memset to assign 0 value immediately after allocating
memory with kzalloc is unnecesaary as kzalloc allocates the memory
filled with 0 value.

Build and tested it.

Signed-off-by: Himanshu Jha <himanshujha199640@xxxxxxxxx>
---
drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c | 2 --
drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c | 5 -----
2 files changed, 7 deletions(-)

diff --git a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
index ee7c3d0..0551c47 100644
--- a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
+++ b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
@@ -5308,7 +5308,6 @@ halmac_write_cam_88xx(struct halmac_adapter *halmac_adapter, u32 entry_index,
cam_entry_format = kzalloc(sizeof(*cam_entry_format), GFP_KERNEL);
if (!cam_entry_format)
return HALMAC_RET_NULL_POINTER;
- memset(cam_entry_format, 0x00, sizeof(*cam_entry_format));

cam_entry_format->key_id = cam_entry_info->key_id;
cam_entry_format->valid = cam_entry_info->valid;
@@ -5461,7 +5460,6 @@ halmac_clear_cam_entry_88xx(struct halmac_adapter *halmac_adapter,
cam_entry_format = kzalloc(sizeof(*cam_entry_format), GFP_KERNEL);
if (!cam_entry_format)
return HALMAC_RET_NULL_POINTER;
- memset(cam_entry_format, 0x00, sizeof(*cam_entry_format));

for (i = 0; i < 8; i++) {
HALMAC_REG_WRITE_32(halmac_adapter, REG_CAMWRITE,
diff --git a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c
index 50f6f25..f33024e 100644
--- a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c
+++ b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c
@@ -691,7 +691,6 @@ halmac_func_pg_efuse_by_map_88xx(struct halmac_adapter *halmac_adapter,
/* out of memory */
return HALMAC_RET_MALLOC_FAIL;
}
- memset(eeprom_mask_updated, 0x00, eeprom_mask_size);

status = halmac_update_eeprom_mask_88xx(halmac_adapter, pg_efuse_info,
eeprom_mask_updated);
@@ -3604,10 +3603,6 @@ halmac_verify_send_rsvd_page_88xx(struct halmac_adapter *halmac_adapter)
return HALMAC_RET_MALLOC_FAIL;
}

- memset(rsvd_page, 0x00,
- h2c_pkt_verify_size +
- halmac_adapter->hw_config_info.txdesc_size);
-
ret_status = halmac_dump_fifo_88xx(
halmac_adapter, HAL_FIFO_SEL_RSVD_PAGE, 0,
h2c_pkt_verify_size +
--
2.7.4