Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1988367ybh; Tue, 14 Jul 2020 12:24:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyH4ugwkKny+3+EL3sTCLGQeU3EpnFS/F2GpF5BUjJrH2fZ1qlX1nnLchdqatUtqYmACPd8 X-Received: by 2002:a17:906:abca:: with SMTP id kq10mr6221357ejb.515.1594754692115; Tue, 14 Jul 2020 12:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594754692; cv=none; d=google.com; s=arc-20160816; b=Ag9NeiGCX6ckhlrV8ve0Pm7vL27zDrdaZPpHyYb2SdmS0Ub5m7icGlJxsxHTlEhcbR CheQhuCrODiu1wyUM+NrcCN/0ZHsK1UP8og+C6uO/mrk2HqT9KezUm+4mn2xqHjYfi8F XwqjCOpUjjYU6BC6Q3DjSVridKx64i1Vz6UjdOmp0/qIT6XnUTINBDjYULYoXmPnLwBg TTSReVSIbEoB9a4lPI+4gO8DMmNfYx21k18ADUJCZEr1XP0ZMIY1NPcaQRyZ51v+Vbve 4Su9KDwxn8iazPgcI5Zz3krQ4tcthVyUznPF7VdRCMdDUZ9k9hlxF3+FqywY80yIjwRT v4EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=TjFtEItXDJJF3EMpHANvZONnJbIrA+pz09QurQ6Vo20=; b=dNfHBfp7FPQPKLofIbQHY7q2jDWAuqAO5oFDIqjoLmU1I58BKJT8ztRkvqKsEl8Leg ppT4tVSeyrSkd7d1FAFNho+hMXZgT2BgvcytuF6RTqlVrsoEZPQOek7mT3WOu/haluU7 rdgm0pcFdbTAVQ7Idq6I9nw9oL9/2s50qefw9cgso7k3tPQ+Y/h/HvlUQW2yIHP8M8DS c2/QdzIhQWvB2+ywt7KNg8Jib8MoSDoP5n65F6ZgWbN2bkHWcuBJ/xrsZMbE03VAr/MM KuXVigBWVl6neMZtpbz/0UDEEd5IGzyebcDRaMFZv/IaMjF8gImhSa4DNHZ9CQQn/3f5 P6IQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f3si11801612edy.2.2020.07.14.12.24.28; Tue, 14 Jul 2020 12:24:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729577AbgGNTWL (ORCPT + 99 others); Tue, 14 Jul 2020 15:22:11 -0400 Received: from smtprelay0022.hostedemail.com ([216.40.44.22]:34252 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727930AbgGNTWL (ORCPT ); Tue, 14 Jul 2020 15:22:11 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 0685B181D337B; Tue, 14 Jul 2020 19:22:08 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2828:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:4605:5007:6691:7514:7903:10004:10400:10848:11026:11232:11658:11914:12043:12296:12297:12438:12555:12663:12740:12760:12895:12986:13439:14181:14659:14721:21080:21324:21451:21627:30054:30055:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: turn41_0b16cbc26ef3 X-Filterd-Recvd-Size: 4228 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA; Tue, 14 Jul 2020 19:22:06 +0000 (UTC) Message-ID: Subject: Re: [PATCH 6/6] staging: qlge: qlge_ethtool: Remove one byte memset. From: Joe Perches To: Suraj Upadhyay Cc: Dan Carpenter , Jeff Kirsher , manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 14 Jul 2020 12:22:05 -0700 In-Reply-To: <20200714190602.GA14742@blackclown> References: <20200713141749.GU2549@kadam> <20200714190602.GA14742@blackclown> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.3-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-07-15 at 00:36 +0530, Suraj Upadhyay wrote: > On Tue, Jul 14, 2020 at 11:57:23AM -0700, Joe Perches wrote: > > On Mon, 2020-07-13 at 17:17 +0300, Dan Carpenter wrote: > > > On Mon, Jul 13, 2020 at 05:52:22PM +0530, Suraj Upadhyay wrote: > > > > Use direct assignment instead of using memset with just one byte as an > > > > argument. > > > > Issue found by checkpatch.pl. > > > > > > > > Signed-off-by: Suraj Upadhyay > > > > --- > > > > Hii Maintainers, > > > > Please correct me if I am wrong here. > > > > --- > > > > > > > > drivers/staging/qlge/qlge_ethtool.c | 4 ++-- > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/staging/qlge/qlge_ethtool.c b/drivers/staging/qlge/qlge_ethtool.c > > > > index 16fcdefa9687..d44b2dae9213 100644 > > > > --- a/drivers/staging/qlge/qlge_ethtool.c > > > > +++ b/drivers/staging/qlge/qlge_ethtool.c > > > > @@ -516,8 +516,8 @@ static void ql_create_lb_frame(struct sk_buff *skb, > > > > memset(skb->data, 0xFF, frame_size); > > > > frame_size &= ~1; > > > > memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1); > > > > - memset(&skb->data[frame_size / 2 + 10], 0xBE, 1); > > > > - memset(&skb->data[frame_size / 2 + 12], 0xAF, 1); > > > > + skb->data[frame_size / 2 + 10] = (unsigned char)0xBE; > > > > + skb->data[frame_size / 2 + 12] = (unsigned char)0xAF; > > > > > > Remove the casting. > > > > > > I guess this is better than the original because now it looks like > > > ql_check_lb_frame(). It's still really weird looking though. > > > > There are several of these in the intel drivers too: > > > > drivers/net/ethernet/intel/e1000/e1000_ethtool.c: memset(&skb->data[frame_size / 2 + 10], 0xBE, 1); > > drivers/net/ethernet/intel/e1000/e1000_ethtool.c: memset(&skb->data[frame_size / 2 + 12], 0xAF, 1); > > drivers/net/ethernet/intel/e1000e/ethtool.c: memset(&skb->data[frame_size / 2 + 10], 0xBE, 1); > > drivers/net/ethernet/intel/e1000e/ethtool.c: memset(&skb->data[frame_size / 2 + 12], 0xAF, 1); > > drivers/net/ethernet/intel/igb/igb_ethtool.c: memset(&skb->data[frame_size + 10], 0xBE, 1); > > drivers/net/ethernet/intel/igb/igb_ethtool.c: memset(&skb->data[frame_size + 12], 0xAF, 1); > > drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c: memset(&skb->data[frame_size + 10], 0xBE, 1); > > drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c: memset(&skb->data[frame_size + 12], 0xAF, 1); > > drivers/staging/qlge/qlge_ethtool.c: memset(&skb->data[frame_size / 2 + 10], 0xBE, 1); > > drivers/staging/qlge/qlge_ethtool.c: memset(&skb->data[frame_size / 2 + 12], 0xAF, 1); > > Thanks to point this out, > I will be sending a patchset for that soon. It _might_ be useful to create and use a standard mechanism for the loopback functions: create_lbtest_frame and check_lbtest_frame Maybe use something like: ether_loopback_frame_create and ether_loopback_frame_check