Commit c808a6ec authored by Xiu Jianfeng's avatar Xiu Jianfeng Committed by Mimi Zohar

evm: Use IS_ENABLED to initialize .enabled

Use IS_ENABLED(CONFIG_XXX) instead of #ifdef/#endif statements to
initialize .enabled, minor simplicity improvement.
Signed-off-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: default avatarAhmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
parent 067d2521
...@@ -36,42 +36,36 @@ static const char * const integrity_status_msg[] = { ...@@ -36,42 +36,36 @@ static const char * const integrity_status_msg[] = {
int evm_hmac_attrs; int evm_hmac_attrs;
static struct xattr_list evm_config_default_xattrnames[] = { static struct xattr_list evm_config_default_xattrnames[] = {
{.name = XATTR_NAME_SELINUX, {
#ifdef CONFIG_SECURITY_SELINUX .name = XATTR_NAME_SELINUX,
.enabled = true .enabled = IS_ENABLED(CONFIG_SECURITY_SELINUX)
#endif
}, },
{.name = XATTR_NAME_SMACK, {
#ifdef CONFIG_SECURITY_SMACK .name = XATTR_NAME_SMACK,
.enabled = true .enabled = IS_ENABLED(CONFIG_SECURITY_SMACK)
#endif
}, },
{.name = XATTR_NAME_SMACKEXEC, {
#ifdef CONFIG_EVM_EXTRA_SMACK_XATTRS .name = XATTR_NAME_SMACKEXEC,
.enabled = true .enabled = IS_ENABLED(CONFIG_EVM_EXTRA_SMACK_XATTRS)
#endif
}, },
{.name = XATTR_NAME_SMACKTRANSMUTE, {
#ifdef CONFIG_EVM_EXTRA_SMACK_XATTRS .name = XATTR_NAME_SMACKTRANSMUTE,
.enabled = true .enabled = IS_ENABLED(CONFIG_EVM_EXTRA_SMACK_XATTRS)
#endif
}, },
{.name = XATTR_NAME_SMACKMMAP, {
#ifdef CONFIG_EVM_EXTRA_SMACK_XATTRS .name = XATTR_NAME_SMACKMMAP,
.enabled = true .enabled = IS_ENABLED(CONFIG_EVM_EXTRA_SMACK_XATTRS)
#endif
}, },
{.name = XATTR_NAME_APPARMOR, {
#ifdef CONFIG_SECURITY_APPARMOR .name = XATTR_NAME_APPARMOR,
.enabled = true .enabled = IS_ENABLED(CONFIG_SECURITY_APPARMOR)
#endif
}, },
{.name = XATTR_NAME_IMA, {
#ifdef CONFIG_IMA_APPRAISE .name = XATTR_NAME_IMA,
.enabled = true .enabled = IS_ENABLED(CONFIG_IMA_APPRAISE)
#endif
}, },
{.name = XATTR_NAME_CAPS, {
.name = XATTR_NAME_CAPS,
.enabled = true .enabled = true
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment