Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3110695imm; Sun, 17 Jun 2018 11:16:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKOB8GQmI3CjwFN5/vFrr9WbasB9WBdmTAXEA0BZVWdZjyigo5x8+kemJinnsbqEiTbtHzu X-Received: by 2002:a62:c61d:: with SMTP id m29-v6mr10516750pfg.26.1529259373979; Sun, 17 Jun 2018 11:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529259373; cv=none; d=google.com; s=arc-20160816; b=KqM4Ik12pEMjMiZppQsWAqHWduEud3PWXRFew/pgV+APbTinqxWwvZynRZ4aR9u7ZB 4UpWVpTj7Yhm0IbUmKpa4GOY76vsDxDfK/v7Y07CrXUj2Wg111fNBkpRA4B/35Jew892 TpX5ePN/tIseizaKcg4Gd+buJYug/LXDGNf2ORImmLyy21RduHN9DVvOt/IEYdumJ0RM B2ICmbDewusKW9sDRE61I4pw1VN0h8hW7Sv6WGEq2jUYGh3kmatfCSOmjyOKN6jF5oNa 5NPwQ2FAPbdC5g4pvnGhZ0OPefIDAkoPG7CwPdfpJwY3zoWSVNtVWOdOANWmMFhUccON Mv1Q== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=ygTESO1ZSvAc5NKrsd8b+USgi2IszKESiLh00FVUnYw=; b=NyjbUL6zs38GA+NQ7OycEkJxqZVaVEvthD9tpntiu/S6JmZm11Lk3ylD72DkE2pFOR aq7bueaQgkcQO+NHjDzfwEj7zzMNrr7GEv5Apr/N7aMPS/Horn/2ZdvbGLVMNTlCtvST 7xxiXLJiqeg7IN2yejYEm6KUh2QmWM3nCYVPUsiY6GV8KayiumhQqiWO3rlBf4b9IwGI ux6HQU+BWNnX+We2tMCAivlU1+TTb6PtcIOT/TWXVqgUrI1sAeeZ7fEl1Jsfi/KO1hCX 3QC0fQyq0L2VKJZzg4BtQ7P37IVUsKU0Os0CZWuQE9+KhZJtjv0C1mhjD3eDjyvY8rG2 GUdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e8-v6si13601727pls.28.2018.06.17.11.15.59; Sun, 17 Jun 2018 11:16:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934154AbeFQSP1 (ORCPT + 99 others); Sun, 17 Jun 2018 14:15:27 -0400 Received: from smtprelay0128.hostedemail.com ([216.40.44.128]:48082 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932524AbeFQSPZ (ORCPT ); Sun, 17 Jun 2018 14:15:25 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id E7B081802EC3D; Sun, 17 Jun 2018 18:15:24 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3871:4321:4605:5007:8603:10004:10400:10848:11026:11232:11658:11914:12043:12296:12555:12740:12760:12895:13069:13311:13357:13439:13972:14096:14097:14181:14659:14721:21080:21451:21627:30003:30054:30091,0,RBL:47.151.150.235:@perches.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:35,LUA_SUMMARY:none X-HE-Tag: net76_2eb2e1bb9c863 X-Filterd-Recvd-Size: 2768 Received: from XPS-9350.home (unknown [47.151.150.235]) (Authenticated sender: joe@perches.com) by omf07.hostedemail.com (Postfix) with ESMTPA; Sun, 17 Jun 2018 18:15:20 +0000 (UTC) Message-ID: <051e78ff15ac6a2e647b0c8c539ac80b3aec6328.camel@perches.com> Subject: Re: [PATCH] net: hamradio: remove unused variable From: Joe Perches To: Stefan Agner , "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 17 Jun 2018 11:15:19 -0700 In-Reply-To: <20180617130335.3947-1-stefan@agner.ch> References: <20180617130335.3947-1-stefan@agner.ch> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 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 Sun, 2018-06-17 at 15:03 +0200, Stefan Agner wrote: > The array bpq_eth_addr is only used to get the size of an > address. Remove the array and use the size of the array > bcast_addr which is actually copied. > > Also constify and tidy up the bcast_addr declaration. > > This fixes a warning seen with clang: > drivers/net/hamradio/bpqether.c:94:13: warning: variable 'bpq_eth_addr' is not > needed and will not be emitted [-Wunneeded-internal-declaration] > static char bpq_eth_addr[6]; > ^ > 1 warning generated. > > Signed-off-by: Stefan Agner > --- > drivers/net/hamradio/bpqether.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c > index f347fd9c5b28..8c9c9977241e 100644 > --- a/drivers/net/hamradio/bpqether.c > +++ b/drivers/net/hamradio/bpqether.c > @@ -89,9 +89,7 @@ > static const char banner[] __initconst = KERN_INFO \ > "AX.25: bpqether driver version 004\n"; > > -static char bcast_addr[6]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; > - > -static char bpq_eth_addr[6]; > +static const char bcast_addr[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; > > static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); > static int bpq_device_event(struct notifier_block *, unsigned long, void *); > @@ -501,8 +499,8 @@ static int bpq_new_device(struct net_device *edev) > bpq->ethdev = edev; > bpq->axdev = ndev; > > - memcpy(bpq->dest_addr, bcast_addr, sizeof(bpq_eth_addr)); > - memcpy(bpq->acpt_addr, bcast_addr, sizeof(bpq_eth_addr)); > + memcpy(bpq->dest_addr, bcast_addr, sizeof(bcast_addr)); > + memcpy(bpq->acpt_addr, bcast_addr, sizeof(bcast_addr)); Probably better to remove bcast_addr altogether and use eth_broadcast_addr(bpq->dst_addr); eth_broadcast_addr(bpq->acpt_addr); > > err = register_netdevice(ndev); > if (err)