From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x227v5HePA0H3jwxy25BykjB6fqXkyV12EwQPFbdaDWbY/qStoS0NuXaijH7v9xCu2PpnB468 ARC-Seal: i=1; a=rsa-sha256; t=1516610531; cv=none; d=google.com; s=arc-20160816; b=fvBMAVB5Tt8MvfMPTvMpvGTLROL3z2K/rla9L+1XVKANqKcU31e/k8J0UwYl6j+Var T3qP6h7b+WvQBjBgsgSMWkkW/1C6O51NZN1GTP/vQ22o8jymor6SFRx1lpsnU/vo5deW 9uatZ5HHqVYgebBBlyHmFBJdasTuOw1oYbRaxiHm8zc+iuUzAHA66u78jcFbk7UHuW+5 N9q0zWQJPuBiINsasx1O0X1LwDXXjRDQ/+89xoVyZiVtrOwxd/tyEr1l1bnZVUamnb93 LvpCs2IOY6N8/CQYmUhDgKLhkYqAyemVZUCSc4YFR+Ybd48ufbAR4nxvT/3Am4Yy63NC Dgmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=NGNsONkL8JEUGlf7almKsaTKNqmmrfRUAIQbjD8K3Y0=; b=I5bazl8pK8hx3h+nTvyKb/lAys6JzIQmsDP/SUM4EXhIYNkLeN6/2NYhxc5Ct6QSPP 3pNE5Q3fkK5bUun62yKFOWO/ypN1KkKnzRF4dPRXaJ4j0+dq6X7k0cQwAm0fY0z/LOLd mjIGGiplzhQz7BfaQQygI0LAq2jy2ERFAEXyiw9bMecvBSL0adQUtvujJdzFtDGECRXh CiqzEqJeRrpiol3CyufbGbasrdvsFKW4vL7GO0aiKJvDtmMu2Hp0c0SGKxaJnubGgZpr WdwkEFFcYucwxrVFqWbZ4SBc7ZuLIzBoC2hCEa9/VNOuBuqUAmyR4PRuEb3sgR1AMYTP 1cLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Michal Marek , Razvan Ghitulete Subject: [PATCH 4.4 09/53] kconfig.h: use __is_defined() to check if MODULE is defined Date: Mon, 22 Jan 2018 09:40:01 +0100 Message-Id: <20180122083910.690478343@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083910.299610926@linuxfoundation.org> References: <20180122083910.299610926@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281404733271754?= X-GMAIL-MSGID: =?utf-8?q?1590281404733271754?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masahiro Yamada commit 4f920843d248946545415c1bf6120942048708ed upstream. The macro MODULE is not a config option, it is a per-file build option. So, config_enabled(MODULE) is not sensible. (There is another case in include/linux/export.h, where config_enabled() is used against a non-config option.) This commit renames some macros in include/linux/kconfig.h for the use for non-config macros and replaces config_enabled(MODULE) with __is_defined(MODULE). I am keeping config_enabled() because it is still referenced from some places, but I expect it would be deprecated in the future. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Marek Signed-off-by: Razvan Ghitulete Signed-off-by: Greg Kroah-Hartman --- include/linux/kconfig.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/include/linux/kconfig.h +++ b/include/linux/kconfig.h @@ -17,10 +17,11 @@ * the last step cherry picks the 2nd arg, we get a zero. */ #define __ARG_PLACEHOLDER_1 0, -#define config_enabled(cfg) _config_enabled(cfg) -#define _config_enabled(value) __config_enabled(__ARG_PLACEHOLDER_##value) -#define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0) -#define ___config_enabled(__ignored, val, ...) val +#define config_enabled(cfg) ___is_defined(cfg) +#define __is_defined(x) ___is_defined(x) +#define ___is_defined(val) ____is_defined(__ARG_PLACEHOLDER_##val) +#define ____is_defined(arg1_or_junk) __take_second_arg(arg1_or_junk 1, 0) +#define __take_second_arg(__ignored, val, ...) val /* * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0 @@ -42,7 +43,7 @@ * built-in code when CONFIG_FOO is set to 'm'. */ #define IS_REACHABLE(option) (config_enabled(option) || \ - (config_enabled(option##_MODULE) && config_enabled(MODULE))) + (config_enabled(option##_MODULE) && __is_defined(MODULE))) /* * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',