[PATCH] ima: simplify if-if to if-else
From: Yihao Han
Date: Thu Apr 14 2022 - 03:12:26 EST
Replace `if (!error)` with `else` for simplification
and add curly brackets according to the kernel coding style:
"Do not unnecessarily use braces where a single statement will do."
...
"This does not apply if only one branch of a conditional statement is
a single statement; in the latter case use braces in both branches"
Please refer to:
https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html
Signed-off-by: Yihao Han <hanyihao@xxxxxxxx>
---
security/integrity/ima/ima_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index 1aebf63ad7a6..b2e43aad496c 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -1068,8 +1068,7 @@ static int __init init_ima(void)
error = register_blocking_lsm_notifier(&ima_lsm_policy_notifier);
if (error)
pr_warn("Couldn't register LSM notifier, error %d\n", error);
-
- if (!error)
+ else
ima_update_policy_flags();
return error;
--
2.17.1