Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752031AbbFZEHj (ORCPT ); Fri, 26 Jun 2015 00:07:39 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34339 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751461AbbFZEHb (ORCPT ); Fri, 26 Jun 2015 00:07:31 -0400 Date: Fri, 26 Jun 2015 09:37:25 +0530 From: Vaishali Thakkar To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] Staging: rtl8192e: Replace memset with eth_zero_addr Message-ID: <20150626040725.GA4005@vaishali-Ideapad-Z570> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1987 Lines: 56 Use eth_zero_addr to assign the zero address to the given address array instead of memset when second argument is address of zero. Note that the 6 in the third argument of memset appears to represent an ethernet address size (ETH_ALEN). The Coccinelle semantic patch that makes this change is as follows: // @eth_zero_addr@ expression e; @@ -memset(e,0x00,6); +eth_zero_addr(e); // Signed-off-by: Vaishali Thakkar --- drivers/staging/rtl8192e/rtl819x_TSProc.c | 2 +- drivers/staging/rtl8192e/rtllib_softmac.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c index 05aea43..70879594 100644 --- a/drivers/staging/rtl8192e/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c @@ -113,7 +113,7 @@ static void TsAddBaProcess(unsigned long data) static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo) { - memset(pTsCommonInfo->Addr, 0, 6); + eth_zero_addr(pTsCommonInfo->Addr); memset(&pTsCommonInfo->TSpec, 0, sizeof(union tspec_body)); memset(&pTsCommonInfo->TClass, 0, sizeof(union qos_tclas)*TCLAS_NUM); pTsCommonInfo->TClasProc = 0; diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index d320c31..1e8b109 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -3084,7 +3084,7 @@ static int rtllib_wpa_enable(struct rtllib_device *ieee, int value) */ netdev_info(ieee->dev, "%s WPA\n", value ? "enabling" : "disabling"); ieee->wpa_enabled = value; - memset(ieee->ap_mac_addr, 0, 6); + eth_zero_addr(ieee->ap_mac_addr); return 0; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/