From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECC42C388F7 for ; Sat, 7 Nov 2020 17:39:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AF49D20878 for ; Sat, 7 Nov 2020 17:39:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728492AbgKGRjr (ORCPT ); Sat, 7 Nov 2020 12:39:47 -0500 Received: from smtprelay0223.hostedemail.com ([216.40.44.223]:39430 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727218AbgKGRjr (ORCPT ); Sat, 7 Nov 2020 12:39:47 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id B98E3181D341E; Sat, 7 Nov 2020 17:39:45 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: side79_2f0f021272dd X-Filterd-Recvd-Size: 2419 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA; Sat, 7 Nov 2020 17:39:44 +0000 (UTC) Message-ID: <6ed68a7898c5505d3106223b7ad47950a0c79dc3.camel@perches.com> Subject: Re: [PATCH] net/dsa: remove unused macros to tame gcc warning From: Joe Perches To: Alex Shi , Florian Fainelli , Andrew Lunn Cc: Vivien Didelot , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 07 Nov 2020 09:39:42 -0800 In-Reply-To: References: <1604641050-6004-1-git-send-email-alex.shi@linux.alibaba.com> <20201106141820.GP933237@lunn.ch> <24690741-cc10-eec1-33c6-7960c8b7fac6@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2020-11-07 at 20:54 +0800, Alex Shi wrote: > 在 2020/11/7 上午12:39, Florian Fainelli 写道: > > > 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. > > Agreed, these definitions are intended to document what the hardware > > does. These warnings are getting too far. > > Thanks for all comments! I agree these info are much meaningful. > Is there other way to tame the gcc warning? like put them into a .h file > or covered by comments? Does _any_ version of gcc have this warning on by default? I still think my proposal of moving the warning from W=2 to W=3 quite reasonable. Another possibility is to turn the warning off altogether.