Commit 2492acaf authored by Ondrej Mosnacek's avatar Ondrej Mosnacek Committed by Paul Moore

selinux: policydb - fix some checkpatch.pl warnings

Fix most of the code style warnings discovered when moving code around.
Signed-off-by: default avatarOndrej Mosnacek <omosnace@redhat.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 0eb2f296
...@@ -334,6 +334,7 @@ static int (*destroy_f[SYM_NUM]) (void *key, void *datum, void *datap) = ...@@ -334,6 +334,7 @@ static int (*destroy_f[SYM_NUM]) (void *key, void *datum, void *datap) =
static int filenametr_destroy(void *key, void *datum, void *p) static int filenametr_destroy(void *key, void *datum, void *p)
{ {
struct filename_trans *ft = key; struct filename_trans *ft = key;
kfree(ft->name); kfree(ft->name);
kfree(key); kfree(key);
kfree(datum); kfree(datum);
...@@ -344,6 +345,7 @@ static int filenametr_destroy(void *key, void *datum, void *p) ...@@ -344,6 +345,7 @@ static int filenametr_destroy(void *key, void *datum, void *p)
static int range_tr_destroy(void *key, void *datum, void *p) static int range_tr_destroy(void *key, void *datum, void *p)
{ {
struct mls_range *rt = datum; struct mls_range *rt = datum;
kfree(key); kfree(key);
ebitmap_destroy(&rt->level[0].cat); ebitmap_destroy(&rt->level[0].cat);
ebitmap_destroy(&rt->level[1].cat); ebitmap_destroy(&rt->level[1].cat);
...@@ -439,6 +441,7 @@ static int filenametr_cmp(struct hashtab *h, const void *k1, const void *k2) ...@@ -439,6 +441,7 @@ static int filenametr_cmp(struct hashtab *h, const void *k1, const void *k2)
static u32 rangetr_hash(struct hashtab *h, const void *k) static u32 rangetr_hash(struct hashtab *h, const void *k)
{ {
const struct range_trans *key = k; const struct range_trans *key = k;
return (key->source_type + (key->target_type << 3) + return (key->source_type + (key->target_type << 3) +
(key->target_class << 5)) & (h->size - 1); (key->target_class << 5)) & (h->size - 1);
} }
...@@ -488,7 +491,8 @@ static int policydb_init(struct policydb *p) ...@@ -488,7 +491,8 @@ static int policydb_init(struct policydb *p)
if (rc) if (rc)
goto out; goto out;
p->filename_trans = hashtab_create(filenametr_hash, filenametr_cmp, (1 << 10)); p->filename_trans = hashtab_create(filenametr_hash, filenametr_cmp,
(1 << 10));
if (!p->filename_trans) { if (!p->filename_trans) {
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
...@@ -664,9 +668,9 @@ static void hash_eval(struct hashtab *h, const char *hash_name) ...@@ -664,9 +668,9 @@ static void hash_eval(struct hashtab *h, const char *hash_name)
struct hashtab_info info; struct hashtab_info info;
hashtab_stat(h, &info); hashtab_stat(h, &info);
pr_debug("SELinux: %s: %d entries and %d/%d buckets used, " pr_debug("SELinux: %s: %d entries and %d/%d buckets used, longest chain length %d\n",
"longest chain length %d\n", hash_name, h->nel, hash_name, h->nel, info.slots_used, h->size,
info.slots_used, h->size, info.max_chain_len); info.max_chain_len);
} }
static void symtab_hash_eval(struct symtab *s) static void symtab_hash_eval(struct symtab *s)
......
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