rsi: remove memset before memcpy
authorHimanshu Jha <himanshujha199640@gmail.com>
Tue, 29 Aug 2017 18:54:50 +0000 (00:24 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 30 Aug 2017 16:51:29 +0000 (19:51 +0300)
calling memcpy immediately after memset with the same region of memory
makes memset redundant.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/rsi/rsi_91x_sdio.c
drivers/net/wireless/rsi/rsi_91x_usb.c

index 742f6cd44f6c0bf705e001cc722e9c4d34dc421b..8d3a4839b6ef1db82d27a8df069b3b16c8f03a9d 100644 (file)
@@ -584,7 +584,6 @@ static int rsi_sdio_load_data_master_write(struct rsi_hw *adapter,
        }
 
        for (offset = 0, i = 0; i < num_blocks; i++, offset += block_size) {
-               memset(temp_buf, 0, block_size);
                memcpy(temp_buf, ta_firmware + offset, block_size);
                lsb_address = (u16)base_address;
                status = rsi_sdio_write_register_multiple
index 9097f7e6229ed731d26c9fc488f6fa98c9e88eb2..81df09dd2636a64190bc7e872bb719deefdce87f 100644 (file)
@@ -439,7 +439,6 @@ static int rsi_usb_load_data_master_write(struct rsi_hw *adapter,
        rsi_dbg(INFO_ZONE, "num_blocks: %d\n", num_blocks);
 
        for (cur_indx = 0, i = 0; i < num_blocks; i++, cur_indx += block_size) {
-               memset(temp_buf, 0, block_size);
                memcpy(temp_buf, ta_firmware + cur_indx, block_size);
                status = rsi_usb_write_register_multiple(adapter, base_address,
                                                         (u8 *)(temp_buf),