Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751231AbdH1KqV (ORCPT ); Mon, 28 Aug 2017 06:46:21 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35663 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750838AbdH1KqU (ORCPT ); Mon, 28 Aug 2017 06:46:20 -0400 From: Himanshu Jha To: gregkh@linuxfoundation.org Cc: kvalo@codeaurora.org, Larry.Finger@lwfinger.net, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Himanshu Jha Subject: [PATCH] staging: rtlwifi: remove memset before memcpy Date: Mon, 28 Aug 2017 16:15:32 +0530 Message-Id: <1503917132-5249-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 712 Lines: 22 calling memcpy immediately after memset with the same region of memory makes memset redundant. Signed-off-by: Himanshu Jha --- drivers/staging/rtlwifi/base.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtlwifi/base.c b/drivers/staging/rtlwifi/base.c index b81f0a9..63ce708 100644 --- a/drivers/staging/rtlwifi/base.c +++ b/drivers/staging/rtlwifi/base.c @@ -2554,7 +2554,6 @@ bool rtl_check_beacon_key(struct ieee80211_hw *hw, void *data, unsigned int len) if (!cur_bcn_key->valid) { /* update cur_beacon_keys */ - memset(cur_bcn_key, 0, sizeof(bcn_key)); memcpy(cur_bcn_key, &bcn_key, sizeof(bcn_key)); cur_bcn_key->valid = true; -- 2.7.4