From patchwork Mon Feb 6 19:05:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1738400 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Y2nDWWFe; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P9bgg5YYKz23r8 for ; Tue, 7 Feb 2023 06:20:15 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 691DF86105; Mon, 6 Feb 2023 20:13:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Y2nDWWFe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4B90D85C3D; Mon, 6 Feb 2023 20:10:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8129285C3D for ; Mon, 6 Feb 2023 20:09:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12f.google.com with SMTP id o13so1270822ilt.4 for ; Mon, 06 Feb 2023 11:09:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sYz0b3ouDEMyLlE0kyxwMcFVDn0skaRMbZI9c3gxCHI=; b=Y2nDWWFepT0G+Eyu2yxLJ+gzmna7wdG6zppaknJF1NNqzodzwoG5FZjmgGu8bB0Zpc m7gda35LfFLWMUOimPXRbnFplcOukx6YvsuavpgEein/Cpb67Oxj9hFb/ZeWsKbuCSSl eZtGbsSmQ+V0psgXyttluQRsrkJTTWO4r0Ogw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sYz0b3ouDEMyLlE0kyxwMcFVDn0skaRMbZI9c3gxCHI=; b=JpLnNP2BP0gmi6Xo5XvX/DUFZl3N9TxCOgPuyDuzLI9VkpDRrMCpM2krs34o4gGBBv ajYyCGvBa3/mPb+mIC1L7Erou9Zw6BnN3tAGI/hfAEUDIrhHdNsvJG/ypmcF5/sLVHdG T+YVDz018Ei3k5RPx2F4xkrIq/EJ6xSDRqRajJHUag9BE43SssqA/fLBxiftyyqhx30c PBEcLoYlhiN4MSMGJXZiFTRWhs16YRJMHJX7chtaVu/OdOsxl8wAW+aGmhlrTLsxCMBH 45hDCPN4djWjNblyzI5LxIc+pnKCj5hqA7ex+Q0FMXIBy/hTTpPzs0CI9g4W36aMn1od je9w== X-Gm-Message-State: AO0yUKW+o6kJIoZ0hcJwC3P3QAcNl+THlZ5l42H+RAQYhSkmfvgApV01 CuOQgQ3k4uXxqSEowNm90I/B1QdIdqQTVVmC X-Google-Smtp-Source: AK7set8p+0TLHF8G3pARKlpLWO0+kOdkIhF26ECQSwZ8lV0rm0BoVLAMIXIYm88cWCVcYXEGOjVmcw== X-Received: by 2002:a92:c243:0:b0:310:e816:8c8c with SMTP id k3-20020a92c243000000b00310e8168c8cmr397471ilo.3.1675710591938; Mon, 06 Feb 2023 11:09:51 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:34e9:6977:1cac:fd32]) by smtp.gmail.com with ESMTPSA id t24-20020a028798000000b00375a885f908sm749878jai.36.2023.02.06.11.09.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 11:09:51 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Masahiro Yamada Subject: [PATCH v3 74/81] kconfig: Drop CONFIG_IS_ENABLED() Date: Mon, 6 Feb 2023 12:05:42 -0700 Message-Id: <20230206190550.1692420-75-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230206190550.1692420-1-sjg@chromium.org> References: <20230206190550.1692420-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean We can use IS_ENABLED() now, so drop the CONFIG_IS_ENABLED() macro. Also drop a comment that mentions it. Signed-off-by: Simon Glass --- Changes in v3: - Drop a comment which mentions CONFIG_IS_ENABLED() drivers/serial/ns16550.c | 1 - include/linux/kconfig.h | 23 ++++++++--------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index ab96cebd4ea..1d384ddbe12 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -610,7 +610,6 @@ static const struct udevice_id ns16550_serial_ids[] = { #if IS_ENABLED(CONFIG_SERIAL_PRESENT) -/* TODO(sjg@chromium.org): Integrate this into a macro like CONFIG_IS_ENABLED */ #if !defined(CONFIG_TPL_BUILD) || defined(CONFIG_TPL_DM_SERIAL) U_BOOT_DRIVER(ns16550_serial) = { .name = "ns16550_serial", diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h index 77d8e6b6129..a2c8e58cb4d 100644 --- a/include/linux/kconfig.h +++ b/include/linux/kconfig.h @@ -61,32 +61,25 @@ #define __unwrap1(case1, case0) __unwrap case1 #define __unwrap0(case1, case0) __unwrap case0 -#define __CONFIG_IS_ENABLED_1(option) __CONFIG_IS_ENABLED_3(option, (1), (0)) -#define __CONFIG_IS_ENABLED_2(option, case1) __CONFIG_IS_ENABLED_3(option, case1, ()) -#define __CONFIG_IS_ENABLED_3(option, case1, case0) \ +#define __IS_ENABLED_1(option) __IS_ENABLED_3(option, (1), (0)) +#define __IS_ENABLED_2(option, case1) __IS_ENABLED_3(option, case1, ()) +#define __IS_ENABLED_3(option, case1, case0) \ __concat(__unwrap, config_enabled(option, 0)) (case1, case0) /* - * CONFIG_IS_ENABLED(CONFIG_FOO) returns 1 if CONFIG_FOO is enabled for the - * phase being built, else 0. + * IS_ENABLED(CONFIG_FOO) returns 1 if CONFIG_FOO is enabled for the phase being + * built, else 0. * * The optional second and third arguments must be parenthesized; that * allows one to include a trailing comma, e.g. for use in * - * CONFIG_IS_ENABLED(CONFIG_ACME, ({.compatible = "acme,frobnozzle"},)) + * IS_ENABLED(CONFIG_ACME, ({.compatible = "acme,frobnozzle"},)) * * which adds an entry to the array being defined if CONFIG_ACME is * set, and nothing otherwise. */ - -#define CONFIG_IS_ENABLED(option, ...) \ - __concat(__CONFIG_IS_ENABLED_, __count_args(option, ##__VA_ARGS__)) (option, ##__VA_ARGS__) - -/* - * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', - * 0 otherwise. - */ -#define IS_ENABLED(option, ...) CONFIG_IS_ENABLED(option, ##__VA_ARGS__) +#define IS_ENABLED(option, ...) \ + __concat(__IS_ENABLED_, __count_args(option, ##__VA_ARGS__)) (option, ##__VA_ARGS__) #ifndef __ASSEMBLY__ /*