Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4955250rdh; Wed, 29 Nov 2023 16:15:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IHT8wFeytni+5TSnOgoLBqyM5eUmb5aVqg1aIPdtQ7y6vrEiaMtgWTHHm0O2fHdbj4ov58C X-Received: by 2002:a17:90b:314b:b0:285:a163:c25b with SMTP id ip11-20020a17090b314b00b00285a163c25bmr15876197pjb.5.1701303342792; Wed, 29 Nov 2023 16:15:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701303342; cv=none; d=google.com; s=arc-20160816; b=tsLxg7UbvADQigeKATRbn7JMg+/t9ke1wngHiYwgEuGJL4CV05UWJDcEhNdiwB2PJB h3YoOED5ni9J6XtNRWQS//ybuTZZGKOkJ23KLxsakw+Bm2IE6lwUiGRDxYMSxgGM4ma6 aqD4WuHBMyANASjUyRuKN8wXm4hL1r2EQ3uBLw1cXaPp6PgVJtskvkWJHBUfyOtW3lqW buxWEawtJN7TMHb0bZsX5WimgMINY8VgbdDKw0s9m1bJ6yrim5p/hZ6TK9qDiaENSNPg 6AnEAwBYQPQbQ7NG5jOgas7u2ina5gkEwP9d068H8fLB8v6ShL0tMhlnQUIK10D50f9k xe5g== 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:dkim-signature; bh=135ym62ynzmlRH3HzMrfBMbytkjQGHryhF5Kat+db4E=; fh=5n1vgNca9S5pGO5RBDYZmuIFZMYDz1oaxxvTTZCEjv4=; b=X9QyVT+YJIQMa9pT3jrhFjYEAoizGldaEabjj/qoTF7AXQcpNQ5rC+eUrUCoB+ANvG lJqjwgIqwXYM4uDc4/nJhQDk0Rq34XJjy3B7uEOltzvetXYMUluW/5a/m6uXimlzqKhz C0812JK2Byw3STuQC0g3yPB5wJwJu0eYypd45yk1L+a6YHn4nfbirYxxcuUNNTnPWg3o xC7ars2VVpnFBJGEGdKl/IP2fYEgHl1aw5O7IrWUuUDfKMh/8tBxxny1MEDdlXd6CfMw tS4LRWvfN7Dl2UP/AhlKBD5KRE5+jcfBpquAoH+z2Y74UJkJy/j5fvNMy8N9nEZ1va1A W94g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LaOgQGHY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id sm2-20020a17090b2e4200b00283a18d5662si81657pjb.80.2023.11.29.16.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 16:15:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LaOgQGHY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2398C80934B8; Wed, 29 Nov 2023 16:15:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343763AbjK3APV (ORCPT + 99 others); Wed, 29 Nov 2023 19:15:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231597AbjK3APU (ORCPT ); Wed, 29 Nov 2023 19:15:20 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 947081A3 for ; Wed, 29 Nov 2023 16:15:26 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDD04C433C8; Thu, 30 Nov 2023 00:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701303326; bh=ch03Q1LGdvw/5c+P9u9UGxtKgAgW7sEGwUb5IoivJ2w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LaOgQGHYkG7GwGuNB/tgApTrq5b0Zwit7TrJGyioetvXKN/uUlcyEuC331mHgnEnz yUhAFGh1JPqoGUjxNIfV5DaeuabXoht1Bhg7CgUWRv0kuhzlGHYfHsqHCp4mEePjHd 8HT0p5x8Ap0Nn4ALSdJ8u2rKNlUzJmLFSRZsM1HSLls97Z1IGR3X/33AWdTFcWjjUm 5mS9hxT8UfIe0M/+rjq7+mUM0jbZPluVzdVNyYvsjWO3jqZFaiBnDlgP6gr/S3Yig0 rqG4ZyRH2T2nbo9DOxillsmRuRLtRaFT6zIvmLzkMZNjGrFbjOctv4eUemPSkJO4VY S6+zbU4oR05CQ== Date: Wed, 29 Nov 2023 17:15:24 -0700 From: Nathan Chancellor To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Nick Desaulniers , Nicolas Schier , linux-kernel@vger.kernel.org Subject: Re: [PATCH] kbuild: support W=c and W=e shorthands for Kconfig Message-ID: <20231130001524.GA2513828@dev-arch.thelio-3990X> References: <20231123090540.485309-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231123090540.485309-1-masahiroy@kernel.org> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 29 Nov 2023 16:15:38 -0800 (PST) On Thu, Nov 23, 2023 at 06:05:40PM +0900, Masahiro Yamada wrote: > KCONFIG_WARN_UNKNOWN_SYMBOLS=1 and KCONFIG_WERROR=1 are descriptive > and suitable in scripting, but it is tedious to type them from the > command line. > > Associate them with KBUILD_EXTRA_WARN (and the W= shorthand). > > Support a new letter 'c' for KBUILD_EXTRA_WARN to enable extra checks > in Kconfig. You can still manage compiler warnings (W=1) and Kconfig > warnings (W=c) independently. > > Reuse the letter 'e' to turn Kconfig warnings into errors. > > As usual, you can combine multiple letters in KCONFIG_EXTRA_WARN. > > $ KCONFIG_WARN_UNKNOWN_SYMBOLS=1 KCONFIG_WERROR=1 make defconfig > > can be shortened to: > > $ KBUILD_EXTRA_WARN=ce make defconfig > > or, even shorter: > > $ make W=ce defconfig > > Signed-off-by: Masahiro Yamada Seems reasonable to me. Reviewed-by: Nathan Chancellor > --- > > Makefile | 10 ++++++++++ > scripts/Makefile.extrawarn | 9 --------- > scripts/kconfig/Makefile | 8 ++++++++ > 3 files changed, 18 insertions(+), 9 deletions(-) > > diff --git a/Makefile b/Makefile > index f128a1a1b1a0..91947f722b77 100644 > --- a/Makefile > +++ b/Makefile > @@ -155,6 +155,15 @@ endif > > export KBUILD_EXTMOD > > +# backward compatibility > +KBUILD_EXTRA_WARN ?= $(KBUILD_ENABLE_EXTRA_GCC_CHECKS) > + > +ifeq ("$(origin W)", "command line") > + KBUILD_EXTRA_WARN := $(W) > +endif > + > +export KBUILD_EXTRA_WARN > + > # Kbuild will save output files in the current working directory. > # This does not need to match to the root of the kernel source tree. > # > @@ -1659,6 +1668,7 @@ help: > @echo ' 1: warnings which may be relevant and do not occur too often' > @echo ' 2: warnings which occur quite often but may still be relevant' > @echo ' 3: more obscure warnings, can most likely be ignored' > + @echo ' c: extra checks in the configuration stage (Kconfig)' > @echo ' e: warnings are being treated as errors' > @echo ' Multiple levels can be combined with W=12 or W=123' > @$(if $(dtstree), \ > diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn > index 2fe6f2828d37..3f94915fab37 100644 > --- a/scripts/Makefile.extrawarn > +++ b/scripts/Makefile.extrawarn > @@ -80,15 +80,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) > # Warn if there is an enum types mismatch > KBUILD_CFLAGS += $(call cc-option,-Wenum-conversion) > > -# backward compatibility > -KBUILD_EXTRA_WARN ?= $(KBUILD_ENABLE_EXTRA_GCC_CHECKS) > - > -ifeq ("$(origin W)", "command line") > - KBUILD_EXTRA_WARN := $(W) > -endif > - > -export KBUILD_EXTRA_WARN > - > # > # W=1 - warnings which may be relevant and do not occur too often > # > diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile > index 4eee155121a8..322c061b464d 100644 > --- a/scripts/kconfig/Makefile > +++ b/scripts/kconfig/Makefile > @@ -27,6 +27,14 @@ KCONFIG_DEFCONFIG_LIST += \ > endif > KCONFIG_DEFCONFIG_LIST += arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) > > +ifneq ($(findstring c, $(KBUILD_EXTRA_WARN)),) > +export KCONFIG_WARN_UNKNOWN_SYMBOLS=1 > +endif > + > +ifneq ($(findstring e, $(KBUILD_EXTRA_WARN)),) > +export KCONFIG_WERROR=1 > +endif > + > # We need this, in case the user has it in its environment > unexport CONFIG_ > > -- > 2.40.1 >