提交 c808a6ec 编写于 作者: X Xiu Jianfeng 提交者: 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: NXiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: NAhmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
上级 067d2521
......@@ -36,42 +36,36 @@ static const char * const integrity_status_msg[] = {
int evm_hmac_attrs;
static struct xattr_list evm_config_default_xattrnames[] = {
{.name = XATTR_NAME_SELINUX,
#ifdef CONFIG_SECURITY_SELINUX
.enabled = true
#endif
{
.name = XATTR_NAME_SELINUX,
.enabled = IS_ENABLED(CONFIG_SECURITY_SELINUX)
},
{.name = XATTR_NAME_SMACK,
#ifdef CONFIG_SECURITY_SMACK
.enabled = true
#endif
{
.name = XATTR_NAME_SMACK,
.enabled = IS_ENABLED(CONFIG_SECURITY_SMACK)
},
{.name = XATTR_NAME_SMACKEXEC,
#ifdef CONFIG_EVM_EXTRA_SMACK_XATTRS
.enabled = true
#endif
{
.name = XATTR_NAME_SMACKEXEC,
.enabled = IS_ENABLED(CONFIG_EVM_EXTRA_SMACK_XATTRS)
},
{.name = XATTR_NAME_SMACKTRANSMUTE,
#ifdef CONFIG_EVM_EXTRA_SMACK_XATTRS
.enabled = true
#endif
{
.name = XATTR_NAME_SMACKTRANSMUTE,
.enabled = IS_ENABLED(CONFIG_EVM_EXTRA_SMACK_XATTRS)
},
{.name = XATTR_NAME_SMACKMMAP,
#ifdef CONFIG_EVM_EXTRA_SMACK_XATTRS
.enabled = true
#endif
{
.name = XATTR_NAME_SMACKMMAP,
.enabled = IS_ENABLED(CONFIG_EVM_EXTRA_SMACK_XATTRS)
},
{.name = XATTR_NAME_APPARMOR,
#ifdef CONFIG_SECURITY_APPARMOR
.enabled = true
#endif
{
.name = XATTR_NAME_APPARMOR,
.enabled = IS_ENABLED(CONFIG_SECURITY_APPARMOR)
},
{.name = XATTR_NAME_IMA,
#ifdef CONFIG_IMA_APPRAISE
.enabled = true
#endif
{
.name = XATTR_NAME_IMA,
.enabled = IS_ENABLED(CONFIG_IMA_APPRAISE)
},
{.name = XATTR_NAME_CAPS,
{
.name = XATTR_NAME_CAPS,
.enabled = true
},
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册