From patchwork Tue Aug 29 18:54:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Jha X-Patchwork-Id: 9927943 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EEF65602B9 for ; Tue, 29 Aug 2017 18:56:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1A6928A24 for ; Tue, 29 Aug 2017 18:56:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D539D28A35; Tue, 29 Aug 2017 18:56:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, RCVD_IN_SORBS_SPAM, RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B10528A29 for ; Tue, 29 Aug 2017 18:56:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751318AbdH2SzG (ORCPT ); Tue, 29 Aug 2017 14:55:06 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34292 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186AbdH2SzE (ORCPT ); Tue, 29 Aug 2017 14:55:04 -0400 Received: by mail-pg0-f67.google.com with SMTP id 63so3342611pgc.1; Tue, 29 Aug 2017 11:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Xl8mNhouS1JUixt/vNZMuif43K6EYvWvQUsxvZwDy+o=; b=sx2W4/PuGTYEcWzg+ffcplqpSMrg9i5b9Wa5voXVTeh8h/s1txocOvysxjBO3l7IZm GWGI7zC99FVt/NvuYf/as/IzET3YLnHTapIY+vAl3sg1IR8g1BpUAgL1wBXKy9r7kEka RaJLPe4bwscb5ScrcDGpX9NsXfa7XsTxR4lES+5f0IRch9xs3bmgNbaO5PsxEc4zA/hr 7Hsq6CD3B38Ks+nTTVOL4IFFSvrZROXNb9Jneem+t1MewKOuPllxuWpvXn54/fxdWzqt 3/bNpfY3+RiDEl5NIYIe5ft08lVbyqkQ/Ob6X1hoVYfiuAgX+ffmTwGNAoiY3b5sXfb8 DHeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Xl8mNhouS1JUixt/vNZMuif43K6EYvWvQUsxvZwDy+o=; b=mKKy3cUZeSNZofWNZddC6UyrzQ9D34azZT3t/lJypmBGN4/GtPrOooWRJbDqss3UJV sed935kPKBRkcCMhTBjSf4vBfy4z90xG6XbxMAr2P+RAT/5ozk484T/rZCJCKSsMEoWo PNZE1SkQst6JaFPv0cBZZyeMXV/rOTGEtqOtSr9e6NWTSg+SgTgcTs4mnA7Foz3GuZ50 mnzkvZQGZl/JDW2ErawxshVG6YL3Fnx5UY/RqLr2R9Do2Swhj6IPbQT74Gr1/LyuR6MB Ut5ihpPo/F0vLiFEdJS6OwO0Mc+CplCreJajoQtyUH0ILVjBqIN/cF9mt+BUsECXTY5w Nhsw== X-Gm-Message-State: AHYfb5hUeL2Mr0nW0nBcSa5hvzsADlmHfocOlx9Bx77gOsYf6Gven7qo bipaXXP+SQRntA== X-Google-Smtp-Source: ADKCNb7ISS9l63QIJgar9zKuKvOi6OO3A0ZsQhS4bedvJFWsf545dQxDM05O18TClJOqNj6mb+D0BQ== X-Received: by 10.84.194.228 with SMTP id h91mr1574222pld.447.1504032904073; Tue, 29 Aug 2017 11:55:04 -0700 (PDT) Received: from localhost.localdomain ([103.254.204.108]) by smtp.gmail.com with ESMTPSA id g1sm6001126pge.69.2017.08.29.11.55.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Aug 2017 11:55:03 -0700 (PDT) From: Himanshu Jha To: kvalo@codeaurora.org Cc: amit.karwar@redpinesignals.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Himanshu Jha Subject: [PATCH] rsi: remove memset before memcpy Date: Wed, 30 Aug 2017 00:24:50 +0530 Message-Id: <1504032890-25229-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP calling memcpy immediately after memset with the same region of memory makes memset redundant. Signed-off-by: Himanshu Jha --- drivers/net/wireless/rsi/rsi_91x_sdio.c | 1 - drivers/net/wireless/rsi/rsi_91x_usb.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c index 742f6cd..8d3a483 100644 --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c @@ -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 diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index 9097f7e..81df09d 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -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),