Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp442919pxb; Mon, 25 Apr 2022 13:24:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyf/g9xfFWDUT4can74iLQXQEqg0/4BUlMxAXfllW1ca236rIJGcqZFSONPyMANuEvCTc4P X-Received: by 2002:a63:6cca:0:b0:3ab:892e:bfa4 with SMTP id h193-20020a636cca000000b003ab892ebfa4mr501712pgc.494.1650918240189; Mon, 25 Apr 2022 13:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650918240; cv=none; d=google.com; s=arc-20160816; b=tmRhZlD3vjBueAhPA3XVO82c07pMAhe8Zu1LdxcFxmgnotVOKNNST5uIiEvPPmUrjM iQhg4vIvB/LRuc8wyngTLq5H4wl1jXli4garHlIGT8C+49YZ1IziQgKmC2iAoKPkjnRd ij1VxOSnLDqJ7BRymW9uesMGdx2nIYrcWPY7ps/LkV66KcyP6tF7xX4rNgPAQx17Udcm C+evzrneW1/dvx1dHP44CNlEnnl+iMZs6xfCxNyVDhaojlCjlpS+LmgxW4FW/w0eDbDf uUwjnY/E97+SCaEt3CEfQdA8ht2W/sKl/jqK5FeqJuVps+D7Mrh3S15ahJ601QH/k7RB +ZDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=aNTlDDtWirtis4MggQ5Un+YcBGuRlQ5g9qZxWmXH6bo=; b=qzIrK6gTwry+qxYCC/Ndz59bqmtih61OQeXh5aQoDcUSD+q2lkJgdX1CkGcpzlCRi4 dfzS5k9V8C5TRkBCxlPk3+WNpONL9Vf30kzAjW66hsLVFQ1K/4D3p3f6IXbtd86GNurP mysVqB4ccGlQz7gIYp1+qPs2awmO9DUx5BK3Q4/ER7XibqEw+lz33llik3VN9T2gBZLo xu8R6hImkxi6h1DELxuNU6b80zPM5nBiHyNz8guVPLUiYft8TtRX2U7Jc40fMmCZ2e9a ZU4N3GsliH3JEgpKNunuRTV38MsbwMlcxS9pBeU4dZUct1c5evuExyMbVsfHAgxo9The W5jA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 21-20020a630715000000b003aa502eb632si18017467pgh.113.2022.04.25.13.23.43; Mon, 25 Apr 2022 13:24:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240172AbiDYHqF convert rfc822-to-8bit (ORCPT + 99 others); Mon, 25 Apr 2022 03:46:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240756AbiDYHp7 (ORCPT ); Mon, 25 Apr 2022 03:45:59 -0400 Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65B863BBD0; Mon, 25 Apr 2022 00:42:37 -0700 (PDT) Received: by mail-yb1-f177.google.com with SMTP id i38so6494132ybj.13; Mon, 25 Apr 2022 00:42:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FzWf0IlKm0WlWwUvnTwOql8/+3g8LAVAbjzV5OJCv40=; b=7dSQtzkcx4U9FTpil+IAC2jKtSfstvWH1WYNPznUi1pkGrtOAi63l+e4u18PoO0xdr 6U3tv3g6XiRMdmd2Gd+oMsKN0vckNur7DTIDh+xg8stT90UzfjF+0sXzyWZJH3k9ulCi pHwg5Dt9R1LDa+x76m+sJVss/Bx0OAH8Zz7JC03RLZQsvhNXiOXFc3cU2EpTZQF7mmC8 CI6Z1p7c4NIiYOj31TyOD4Vj3iNuI+Pkffkj91Xj0FTlG51VZKvRcZhhY8U5VuTvLnY/ 22e85XaZgHo37LBDxWfgIkepJCm/9frVlJOudzUMDpZwNxDvA23Y9Q6GWC7B9soQAa78 Am5w== X-Gm-Message-State: AOAM533Rz4iPb20UIcopLJjSEBh/9bfIbtfWZQq/gPtP2szxjfPrwBaz ICcX+trc1FPmwCwZQLLSju2X6IpTdXOVi1d9EQ8= X-Received: by 2002:a25:df0a:0:b0:648:6364:a150 with SMTP id w10-20020a25df0a000000b006486364a150mr3606038ybg.381.1650872556572; Mon, 25 Apr 2022 00:42:36 -0700 (PDT) MIME-Version: 1.0 References: <20220422151725.1336997-1-mailhol.vincent@wanadoo.fr> In-Reply-To: From: Vincent MAILHOL Date: Mon, 25 Apr 2022 16:42:25 +0900 Message-ID: Subject: Re: [PATCH] checksyscalls: ignore -Wunused-macros To: Arnd Bergmann Cc: Nathan Chancellor , Nick Desaulniers , Tom Rix , Linux Kernel Mailing List , clang-built-linux , Linux API Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon. 25 Apr 2022 at 15:50, Arnd Bergmann wrote: > On Mon, Apr 25, 2022 at 8:17 AM Vincent MAILHOL > wrote: > > On Mon. 25 Apr 2022 at 07:17, Nathan Chancellor wrote: > > > Hi Vincent, > > > > > > On Sat, Apr 23, 2022 at 12:17:25AM +0900, Vincent Mailhol wrote: > > > > The macros defined in this file are for testing only and are purposely > > > > not used. When compiled with W=2, both gcc and clang yield some > > > > -Wunused-macros warnings. Ignore them. > > > > > > > > Signed-off-by: Vincent Mailhol > > > > > > The change itself looks fine but a couple of comments: > > > > > > 1. Nick and I do not pick up patches, we rely on others to do so. > > > Additionally, this is not really something within our domain, despite > > > what get_maintainer.pl might say. This change should be sent to > > > either > > > > > > Masahiro Yamada > > > linux-kbuild@vger.kernel.org > > > > > > or > > > > > > Andrew Morton > > > > > > so that it can be applied by one of them. > > > > Ack. As you pointed out, I indeed just followed get_maintainer.pl. > > I will resend a v2 to the people you pointed out (and exclude you). > > > > > 2. I am not sure that silencing warnings from W=2 is that useful, as > > > they are unlikely to be real issues. Not to discourage you by any > > > means but it might be more useful to focus on cleaning up warnings > > > from W=1 and getting those promoted to regular build warnings. > > > > Normally I agree, but there is one reason to fix this W=2: this > > warning appears when building other files. > > > > Example: > > | $ make W=2 drivers/net/dummy.o > > | CALL scripts/checksyscalls.sh > > | :21: warning: macro "__IGNORE_stat64" is not used [-Wunused-macros] > > | :22: warning: macro "__IGNORE_lstat64" is not used [-Wunused-macros] > > | :75: warning: macro "__IGNORE_llseek" is not used [-Wunused-macros] > > | :159: warning: macro "__IGNORE_madvise1" is not used [-Wunused-macros] > > (rest of the output redacted). > > > > When I run W=2, I want to only see the warnings of the file I am > > working on. So I find it useful to fix the W=2 warnings which > > show up when building other files to not get spammed by > > irrelevant issues and to simplify the triage. > > > > My initial message lacked the rationale. I will add additional > > explanations in the v2 of this patch. > > I agree this is worth fixing if we want to make W=2 have any meaning at all. > > Your approach is probably fine. We could try to improve this by comparing > against the list from include/uapi/asm-generic/unistd.h instead of the i386 > list. I suppose that would involve rewriting the script into a simpler one, > but I'm not sure if anyone has an interest in working on this. If someone wants to do it, great, but I do not have the confidence to do it myself so I hope you will forgive me for taking a pass here. Another alternative I considered was to only call checksyscalls.sh when doing a 'make all'. This way, we keep the warning but people won’t be spammed when building sub projects because the script would not be executed. I tried to be as less disruptive as possible. Unless people show interest in one of the alternative approaches, I will keep using the -Wno-unused-macros approach in the v2. > diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh > index 9dbab13329fa..cde15f22ec98 100755 > --- a/scripts/checksyscalls.sh > +++ b/scripts/checksyscalls.sh > @@ -255,6 +255,7 @@ cat << EOF > /* 64-bit ports never needed these, and new 32-bit ports can use statx */ > #define __IGNORE_fstat64 > #define __IGNORE_fstatat64 > + Just realized that I added a new line for no reason. This will be removed in v2. Sorry. > EOF > } > > @@ -268,4 +269,4 @@ syscall_list() { > } > > (ignore_list && syscall_list $(dirname $0)/../arch/x86/entry/syscalls/syscall_32.tbl) | \ > -$* -Wno-error -E -x c - > /dev/null > +$* -Wno-error -Wno-unused-macros -E -x c - > /dev/null > -- > 2.35.1 Yours sincerely, Vincent Mailhol