Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1299089pxb; Fri, 6 Nov 2020 06:20:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWYH15GcOD3XXJni9nTvSr2YQ6j0Mn+3t5ycSUizfpDQm+0ag7342fNnqZ2A8yY1beNfat X-Received: by 2002:aa7:c34c:: with SMTP id j12mr2273504edr.17.1604672434032; Fri, 06 Nov 2020 06:20:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604672434; cv=none; d=google.com; s=arc-20160816; b=GNJl4Og3ttAmYFpn5gvPPbUbekLsCFfr2a62vEGKHQbPnWNQO7oEKspkiOI0xX0wco lEl8Mmb8Rxp1OqZ1GxPfcJJYHlZfFE0gpxKqewOFxW1bh4WAI2Jbkd3sn/zLo9hWQbzD 28q/tHGXe4NWVgd1T3pFKYmiF0LLhASuS83ekEQsh5OJTo1moeyuuStPuHKfFXtiF+tE YNw4syd7oS413AYwukyPdC5DQoGisSYNM6doSEJAXSwKXV2Y7Vz593eZ6FJfs1xsrN6R 26bje2CRESUfF0fFVNklYRgpLdH114mpYePH+PniNgjEsh+asRxC6Dwr95huRtCtYAfh 7SCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=PWpqMTOlm0JArk11eSd21InoiaPqN+z1zBhaTaOwtFc=; b=Wv0LK03WNRNAGmDoRQa23YlgvJjm9N9araCOxnNhDTyeh2eFwy8QqAhC/h8zM1chLJ p7ixb3VuWVHjHwD+WB65CDyEHRoL9I9cXLsEe6Go06ClCMrEZdhZlglj3uqkpdn+2dwn SlXoLR6Vh6R8DPx7F4s+fxZOCZxyAbLcUpnK1SZTnxHxKqNxIU6HzyzNr3/yNKLIGSeW Jud3by9WyhIyBBxfcQww+1rmGSWMKt1AIrkGyZYrdna4GINt5ogh86SoVgImANBacQZ2 CN/6OpwtBi4aVtL9QLyAYTozFP7gWEUn1KibqNFpzOGlk/8qLrIFdpXpOUCfeaaEibUE +y+w== 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 h23si1016440edt.81.2020.11.06.06.20.06; Fri, 06 Nov 2020 06:20:34 -0800 (PST) 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 S1727375AbgKFOSe (ORCPT + 99 others); Fri, 6 Nov 2020 09:18:34 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:39242 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726812AbgKFOSd (ORCPT ); Fri, 6 Nov 2020 09:18:33 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kb2ZI-005cCn-1E; Fri, 06 Nov 2020 15:18:20 +0100 Date: Fri, 6 Nov 2020 15:18:20 +0100 From: Andrew Lunn To: Alex Shi Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net/dsa: remove unused macros to tame gcc warning Message-ID: <20201106141820.GP933237@lunn.ch> References: <1604641050-6004-1-git-send-email-alex.shi@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1604641050-6004-1-git-send-email-alex.shi@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 06, 2020 at 01:37:30PM +0800, Alex Shi wrote: > There are some macros unused, they causes much gcc warnings. Let's > remove them to tame gcc. > > net/dsa/tag_brcm.c:51:0: warning: macro "BRCM_EG_RC_SWITCH" is not used > [-Wunused-macros] > net/dsa/tag_brcm.c:53:0: warning: macro "BRCM_EG_RC_MIRROR" is not used > [-Wunused-macros] > net/dsa/tag_brcm.c:55:0: warning: macro "BRCM_EG_TC_MASK" is not used > [-Wunused-macros] > net/dsa/tag_brcm.c:35:0: warning: macro "BRCM_IG_TS_SHIFT" is not used > [-Wunused-macros] > net/dsa/tag_brcm.c:46:0: warning: macro "BRCM_EG_RC_MASK" is not used > [-Wunused-macros] > net/dsa/tag_brcm.c:49:0: warning: macro "BRCM_EG_RC_PROT_SNOOP" is not > used [-Wunused-macros] > net/dsa/tag_brcm.c:34:0: warning: macro "BRCM_IG_TE_MASK" is not used > [-Wunused-macros] > net/dsa/tag_brcm.c:43:0: warning: macro "BRCM_EG_CID_MASK" is not used > [-Wunused-macros] > net/dsa/tag_brcm.c:50:0: warning: macro "BRCM_EG_RC_PROT_TERM" is not > used [-Wunused-macros] > net/dsa/tag_brcm.c:54:0: warning: macro "BRCM_EG_TC_SHIFT" is not used > [-Wunused-macros] > net/dsa/tag_brcm.c:52:0: warning: macro "BRCM_EG_RC_MAC_LEARN" is not > used [-Wunused-macros] > net/dsa/tag_brcm.c:48:0: warning: macro "BRCM_EG_RC_EXCEPTION" is not > used [-Wunused-macros] > > Signed-off-by: Alex Shi > Cc: Andrew Lunn > Cc: Vivien Didelot > Cc: Florian Fainelli > Cc: Vladimir Oltean > Cc: "David S. Miller" > Cc: Jakub Kicinski > Cc: netdev@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > --- > net/dsa/tag_brcm.c | 15 --------------- > 1 file changed, 15 deletions(-) > > diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c > index e934dace3922..ce23b5d4c6b8 100644 > --- a/net/dsa/tag_brcm.c > +++ b/net/dsa/tag_brcm.c > @@ -30,29 +30,14 @@ > /* 1st byte in the tag */ > #define BRCM_IG_TC_SHIFT 2 > #define BRCM_IG_TC_MASK 0x7 > -/* 2nd byte in the tag */ > -#define BRCM_IG_TE_MASK 0x3 > -#define BRCM_IG_TS_SHIFT 7 > /* 3rd byte in the tag */ > #define BRCM_IG_DSTMAP2_MASK 1 > #define BRCM_IG_DSTMAP1_MASK 0xff Hi Alex It is good to remember that there are multiple readers of source files. There is the compiler which generates code from it, and there is the human trying to understand what is going on, what the hardware can do, how we could maybe extend the code in the future to make use of bits are currently don't, etc. The compiler has no use of these macros, at the moment. But i as a human do. It is valuable documentation, given that there is no open datasheet for this hardware. I would say these warnings are bogus, and the code should be left alone. Andrew