SELinux: avtab.c whitespace, syntax, and static declaraction cleanups
This patch changes avtab.c to fix whitespace and syntax issues. Things that are fixed may include (does not not have to include) whitespace at end of lines spaces followed by tabs spaces used instead of tabs spacing around parenthesis locateion of { around struct and else clauses location of * in pointer declarations removal of initialization of static data to keep it in the right section useless {} in if statemetns useless checking for NULL before kfree fixing of the indentation depth of switch statements and any number of other things I forgot to mention Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
@@ -33,10 +33,10 @@ static inline int avtab_hash(struct avtab_key *keyp, u16 mask)
|
|||||||
|
|
||||||
static struct avtab_node*
|
static struct avtab_node*
|
||||||
avtab_insert_node(struct avtab *h, int hvalue,
|
avtab_insert_node(struct avtab *h, int hvalue,
|
||||||
struct avtab_node * prev, struct avtab_node * cur,
|
struct avtab_node *prev, struct avtab_node *cur,
|
||||||
struct avtab_key *key, struct avtab_datum *datum)
|
struct avtab_key *key, struct avtab_datum *datum)
|
||||||
{
|
{
|
||||||
struct avtab_node * newnode;
|
struct avtab_node *newnode;
|
||||||
newnode = kmem_cache_zalloc(avtab_node_cachep, GFP_KERNEL);
|
newnode = kmem_cache_zalloc(avtab_node_cachep, GFP_KERNEL);
|
||||||
if (newnode == NULL)
|
if (newnode == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -84,7 +84,7 @@ static int avtab_insert(struct avtab *h, struct avtab_key *key, struct avtab_dat
|
|||||||
}
|
}
|
||||||
|
|
||||||
newnode = avtab_insert_node(h, hvalue, prev, cur, key, datum);
|
newnode = avtab_insert_node(h, hvalue, prev, cur, key, datum);
|
||||||
if(!newnode)
|
if (!newnode)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -95,7 +95,7 @@ static int avtab_insert(struct avtab *h, struct avtab_key *key, struct avtab_dat
|
|||||||
* It also returns a pointer to the node inserted.
|
* It also returns a pointer to the node inserted.
|
||||||
*/
|
*/
|
||||||
struct avtab_node *
|
struct avtab_node *
|
||||||
avtab_insert_nonunique(struct avtab * h, struct avtab_key * key, struct avtab_datum * datum)
|
avtab_insert_nonunique(struct avtab *h, struct avtab_key *key, struct avtab_datum *datum)
|
||||||
{
|
{
|
||||||
int hvalue;
|
int hvalue;
|
||||||
struct avtab_node *prev, *cur, *newnode;
|
struct avtab_node *prev, *cur, *newnode;
|
||||||
@@ -398,7 +398,8 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol,
|
|||||||
key.specified = spec_order[i] | enabled;
|
key.specified = spec_order[i] | enabled;
|
||||||
datum.data = le32_to_cpu(buf32[items++]);
|
datum.data = le32_to_cpu(buf32[items++]);
|
||||||
rc = insertf(a, &key, &datum, p);
|
rc = insertf(a, &key, &datum, p);
|
||||||
if (rc) return rc;
|
if (rc)
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -513,5 +514,5 @@ void avtab_cache_init(void)
|
|||||||
|
|
||||||
void avtab_cache_destroy(void)
|
void avtab_cache_destroy(void)
|
||||||
{
|
{
|
||||||
kmem_cache_destroy (avtab_node_cachep);
|
kmem_cache_destroy(avtab_node_cachep);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user