staging: r8822be: remove unnecessary call to memset
authorHimanshu Jha <himanshujha199640@gmail.com>
Sun, 27 Aug 2017 13:23:56 +0000 (18:53 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Aug 2017 17:59:10 +0000 (19:59 +0200)
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@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c

index ee7c3d0a6e345dd013bd2ce5fabcbcbbc207eaa6..0551c471ac43e895d1738e4f86315fac9ebf50dc 100644 (file)
@@ -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,
index 50f6f256795a618efd0477cb1f5c3856c3f5ca32..f33024e4d853de78ae699f50a6b77b177c1a54ae 100644 (file)
@@ -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 +