From: Ahmad Fatoum <a.fatoum@pengutronix.de> Date: 2022-06-07 06:07:02
On 06.06.22 12:10, Xiu Jianfeng wrote:
Use IS_ENABLED(CONFIG_XXX) instead of #ifdef/#endif statements to
initialize .enabled, minor simplicity improvement.
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Use IS_ENABLED(CONFIG_XXX) instead of #ifdef/#endif statements to
initialize .enabled, minor simplicity improvement.
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
thank you for the review, and I'm not sure if this patch has been
picked, so frendly ping here...
On Tue, 2022-06-21 at 18:58 +0800, xiujianfeng wrote:
Hi, Ahmad
在 2022/6/7 14:06, Ahmad Fatoum 写道:
quoted
On 06.06.22 12:10, Xiu Jianfeng wrote:
quoted
Use IS_ENABLED(CONFIG_XXX) instead of #ifdef/#endif statements to
initialize .enabled, minor simplicity improvement.
The difference between using ifdef's and IS_ENABLED is when the
decision is made - build time, run time. Please update the patch
description providing an explanation for needing to make the decision
at run time.
thanks,
Mimi
From: Eric Biggers <ebiggers@kernel.org> Date: 2022-06-22 02:17:53
On Tue, Jun 21, 2022 at 10:03:39AM -0400, Mimi Zohar wrote:
On Tue, 2022-06-21 at 18:58 +0800, xiujianfeng wrote:
quoted
Hi, Ahmad
在 2022/6/7 14:06, Ahmad Fatoum 写道:
quoted
On 06.06.22 12:10, Xiu Jianfeng wrote:
quoted
Use IS_ENABLED(CONFIG_XXX) instead of #ifdef/#endif statements to
initialize .enabled, minor simplicity improvement.
The difference between using ifdef's and IS_ENABLED is when the
decision is made - build time, run time. Please update the patch
description providing an explanation for needing to make the decision
at run time.
thanks,
IS_ENABLED() is a compile time constant. So the patch looks fine to me.
- Eric
On Tue, 2022-06-21 at 19:17 -0700, Eric Biggers wrote:
On Tue, Jun 21, 2022 at 10:03:39AM -0400, Mimi Zohar wrote:
quoted
On Tue, 2022-06-21 at 18:58 +0800, xiujianfeng wrote:
quoted
Hi, Ahmad
在 2022/6/7 14:06, Ahmad Fatoum 写道:
quoted
On 06.06.22 12:10, Xiu Jianfeng wrote:
quoted
Use IS_ENABLED(CONFIG_XXX) instead of #ifdef/#endif statements to
initialize .enabled, minor simplicity improvement.
The difference between using ifdef's and IS_ENABLED is when the
decision is made - build time, run time. Please update the patch
description providing an explanation for needing to make the decision
at run time.
thanks,
IS_ENABLED() is a compile time constant. So the patch looks fine to me.
Thanks, Eric, for the clarification.
As LSMs are only builtin, why the need for using IS_ENABLED as opposed
to IS_BUILTIN?
#define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option))
thanks,
Mimi
On Tue, 2022-06-21 at 19:17 -0700, Eric Biggers wrote:
quoted
On Tue, Jun 21, 2022 at 10:03:39AM -0400, Mimi Zohar wrote:
quoted
On Tue, 2022-06-21 at 18:58 +0800, xiujianfeng wrote:
quoted
Hi, Ahmad
在 2022/6/7 14:06, Ahmad Fatoum 写道:
quoted
On 06.06.22 12:10, Xiu Jianfeng wrote:
quoted
Use IS_ENABLED(CONFIG_XXX) instead of #ifdef/#endif statements to
initialize .enabled, minor simplicity improvement.
The difference between using ifdef's and IS_ENABLED is when the
decision is made - build time, run time. Please update the patch
description providing an explanation for needing to make the decision
at run time.
thanks,
IS_ENABLED() is a compile time constant. So the patch looks fine to me.
Thanks, Eric, for the clarification.
As LSMs are only builtin, why the need for using IS_ENABLED as opposed
to IS_BUILTIN?
#define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option))
thanks,
I think IS_ENALBED() is a bit more generic, maybe. here is another
example in rcutorture.c
which uses IS_ENABLED() to initialize the member in structure:
static struct rcu_torture_ops rcu_ops = {
...
.can_boost = IS_ENABLED(CONFIG_RCU_BOOST),
...
};
Do you want me to change IS_ENABLED() to IS_BUILTIN()?
On Mon, 2022-06-06 at 18:10 +0800, Xiu Jianfeng wrote:
Use IS_ENABLED(CONFIG_XXX) instead of #ifdef/#endif statements to
initialize .enabled, minor simplicity improvement.
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Thanks, Xiu. This patch is now queued in next-testing.
Mimi