Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3135742imm; Sun, 17 Jun 2018 11:59:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJeswFa8I5i2vRaEKgOMw2ZapgJFGmVSfrzxwkPICtPQyH4OQ1iwX/Bxg7aW03jd0r2Nww8 X-Received: by 2002:a65:5ac9:: with SMTP id d9-v6mr8619098pgt.238.1529261952764; Sun, 17 Jun 2018 11:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529261952; cv=none; d=google.com; s=arc-20160816; b=XhZ1sPXJIGINoTqmLVgL2Le9j4fh5yMDZVL5b5YurcpL6EDYyQIPOoFeYO3o7K2flF 2r31zNQornsZJ4Dcquj5Y3WGDoYQH7SFebEF6tHof7RhdUC/Ifi2F7TQPUY4kAN3RVxU eIyoECSVcVG1LHhN8OaQ00hzBFndQ2lTgUeCLvviaCAy+CTb7DmousNUBfKBLpehyNKo VPTVH7dcx4EoejMoGRL0TdallS4VouiXBKx1tcTezNg4jbwkYDUVYnsgwswQwKH9iN33 aQ2dsRlQpMjwFbvdSukqKdrpkEhH6t/SeQf2XcGdSDd2AiAyrKuhwPzm66YOzNFTAnSV IBJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=DrNTsVYlzr5yMhQlyFuAKQGtEqTaTyOM5AGsbfR+7ww=; b=F6VTp4XYJDKl7a2jm7OFA3ugKcE0L7P81SBL6XdCP5LovVk15FfA+j5DV0b+eOv/C6 p2g72v/UW6sHWWf3O1YVHbfW2Z5PdduklCnp2eAI7bTYUNMRSxT0MWaOb17Bu7GcHsWE qWwsOBh80acYmH570IAxlWh9nWbdqEXVV1qDgAyt5RhvH3giPi4Ab5Xeo+ndKLhGCM30 vVuKoDruiHEbXXOMhcvVKR/ajEb1w0pwqk2zkctArshhQ3tnNhSVpmElpvR4QcbsNg/j /G++UEqxxO1Nh/riCnMOWIkdQd8lwZNINW3qDk7B3/HkKl3qOb82R7eGUPn/kSQwHNSU FSDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=UX3bHyQf; 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 d66-v6si10584441pgc.141.2018.06.17.11.58.57; Sun, 17 Jun 2018 11:59:12 -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; dkim=pass header.i=@agner.ch header.s=dkim header.b=UX3bHyQf; 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 S1754256AbeFQS5l (ORCPT + 99 others); Sun, 17 Jun 2018 14:57:41 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:49172 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752696AbeFQS5k (ORCPT ); Sun, 17 Jun 2018 14:57:40 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id B1A7E5C0E8F; Sun, 17 Jun 2018 20:57:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1529261858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DrNTsVYlzr5yMhQlyFuAKQGtEqTaTyOM5AGsbfR+7ww=; b=UX3bHyQfpK+KUe4yMpu0Z+Hh+vx3+RtthVs5jR6MejLPsxKAv7/1eVjIBZZoLoZ+iwZkz2 IHAoeI8n3tX0N1v+eeFIda6KTYx8bhbOmTKjBzyVVwaNWLA3JmlppH8rpQZqdEONu4zW4E bsc2RSJISxSAmtSNB7cxT4ce/Dhswt4= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Sun, 17 Jun 2018 20:57:38 +0200 From: Stefan Agner To: Joe Perches Cc: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: hamradio: remove unused variable In-Reply-To: <051e78ff15ac6a2e647b0c8c539ac80b3aec6328.camel@perches.com> References: <20180617130335.3947-1-stefan@agner.ch> <051e78ff15ac6a2e647b0c8c539ac80b3aec6328.camel@perches.com> Message-ID: <89a40f827d9557141707b87a86533593@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 X-Spamd-Result: default: False [-3.10 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17.06.2018 20:15, Joe Perches wrote: > 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); > Sounds sensible, will send a v2. -- Stefan > >> >> err = register_netdevice(ndev); >> if (err)