staging: rtlwifi: remove memset before memcpy
authorHimanshu Jha <himanshujha199640@gmail.com>
Mon, 28 Aug 2017 10:45:32 +0000 (16:15 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Aug 2017 06:24:03 +0000 (08:24 +0200)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtlwifi/base.c

index 9a045c7..b88b0e8 100644 (file)
@@ -2558,7 +2558,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;