Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752507AbbBYE7O (ORCPT ); Tue, 24 Feb 2015 23:59:14 -0500 Received: from mail-wi0-f175.google.com ([209.85.212.175]:59134 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751959AbbBYE7N (ORCPT ); Tue, 24 Feb 2015 23:59:13 -0500 Date: Wed, 25 Feb 2015 06:59:07 +0200 From: Aya Mahfouz To: Joe Perches Cc: Andy Whitcroft , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] scripts: checkpatch.pl: add 2 new checks on memset calls Message-ID: <20150225045907.GC9220@localhost.localdomain> References: <20150225024043.GA9120@localhost.localdomain> <1424833852.11070.1.camel@perches.com> <20150225043521.GB9220@localhost.localdomain> <1424839283.11070.9.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424839283.11070.9.camel@perches.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4641 Lines: 114 On Tue, Feb 24, 2015 at 08:41:23PM -0800, Joe Perches wrote: > On Wed, 2015-02-25 at 06:35 +0200, Aya Mahfouz wrote: > > On Tue, Feb 24, 2015 at 07:10:52PM -0800, Joe Perches wrote: > > > On Wed, 2015-02-25 at 04:40 +0200, Aya Mahfouz wrote: > > > > This patch adds 2 new checks on memset calls in the file > > > > checkpatch.pl as follows: > [] > > ok, I didn't see your suggestion, sorry. > > No worries. > > > Can you look at the following > > modification before sending the third patch? I don't use $stat because > > I get false positives with it. > > Please describe the false positives. > > ok, here are the relevant warnings issued by checkpatch.pl when using $stat for the file drivers/staging/rtl8188eu/os_dep/ioctl_linux.c. The only correct results are lines 95, 830, 1031, 1040, 1908. WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #95: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:95: + memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #775: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:775: +} WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #777: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:777: +static int rtw_wx_set_pmkid(struct net_device *dev, WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #778: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:778: + struct iw_request_info *a, WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #779: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:779: + union iwreq_data *wrqu, char *extra) WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #780: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:780: +{ WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #823: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:823: + } WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #824: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:824: + } else if (pPMK->cmd == IW_PMKSA_REMOVE) { WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #827: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:827: + for (j = 0; j < NUM_PMKID_CACHE; j++) { WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #828: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:828: + if (!memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN)) { WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #830: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:830: + memset(psecuritypriv->PMKIDList[j].Bssid, 0x00, ETH_ALEN); WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #1019: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:1019: +} WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #1021: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:1021: +static int rtw_wx_get_wap(struct net_device *dev, WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #1022: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:1022: + struct iw_request_info *info, WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #1023: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:1023: + union iwreq_data *wrqu, char *extra) WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #1024: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:1024: +{ WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #1031: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:1031: + memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #1039: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:1039: + else WARNING: Prefer eth_zero_addr() over memset() if the second address is 0x00 #1040: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:1040: + memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); WARNING: Prefer eth_broadcast_addr() over memset() if the second address is 0xff #1908: FILE: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:1908: + memset(param->sta_addr, 0xff, ETH_ALEN); -- Kind Regards, Aya Saif El-yazal Mahfouz -- 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/