Skip to content

Commit a748372

Browse files
committed
lsm: rename exists_ordered_lsm() to lsm_order_exists()
Also add a header comment block to the function. Reviewed-by: Casey Schaufler <casey@schaufler-ca.com> Reviewed-by: John Johansen <john.johhansen@canonical.com> Reviewed-by: Mimi Zohar <zohar@linux.ibm.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent 2d67172 commit a748372

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

security/lsm_init.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,11 @@ static inline bool lsm_is_enabled(struct lsm_info *lsm)
108108
return (lsm->enabled ? *lsm->enabled : false);
109109
}
110110

111-
/* Is an LSM already listed in the ordered LSMs list? */
112-
static bool __init exists_ordered_lsm(struct lsm_info *lsm)
111+
/**
112+
* lsm_order_exists - Determine if a LSM exists in the ordered list
113+
* @lsm: LSM definition
114+
*/
115+
static bool __init lsm_order_exists(struct lsm_info *lsm)
113116
{
114117
struct lsm_info **check;
115118

@@ -126,7 +129,7 @@ static int last_lsm __initdata;
126129
static void __init append_ordered_lsm(struct lsm_info *lsm, const char *from)
127130
{
128131
/* Ignore duplicate selections. */
129-
if (exists_ordered_lsm(lsm))
132+
if (lsm_order_exists(lsm))
130133
return;
131134

132135
if (WARN(last_lsm == MAX_LSM_COUNT, "%s: out of LSM static calls!?\n", from))
@@ -269,7 +272,7 @@ static void __init ordered_lsm_parse(const char *order, const char *origin)
269272
/* Process "security=", if given. */
270273
if (lsm_order_legacy) {
271274
lsm_for_each_raw(lsm) {
272-
if (exists_ordered_lsm(lsm))
275+
if (lsm_order_exists(lsm))
273276
continue;
274277
if (strcmp(lsm->id->name, lsm_order_legacy) == 0)
275278
append_ordered_lsm(lsm, "security=");
@@ -284,7 +287,7 @@ static void __init ordered_lsm_parse(const char *order, const char *origin)
284287

285288
/* Disable all LSMs not in the ordered list. */
286289
lsm_for_each_raw(lsm) {
287-
if (exists_ordered_lsm(lsm))
290+
if (lsm_order_exists(lsm))
288291
continue;
289292
lsm_enabled_set(lsm, false);
290293
init_debug("%s skipped: %s (not in requested order)\n",

0 commit comments

Comments
 (0)