Skip to content

Commit a84f5aa

Browse files
committed
selinux: fix style issues in security/selinux/ss/hashtab.h
As part of on ongoing effort to perform more automated testing and provide more tools for individual developers to validate their patches before submitting, we are trying to make our code "clang-format clean". My hope is that once we have fixed all of our style "quirks", developers will be able to run clang-format on their patches to help avoid silly formatting problems and ensure their changes fit in well with the rest of the SELinux kernel code. Signed-off-by: Paul Moore <[email protected]>
1 parent e951485 commit a84f5aa

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

security/selinux/ss/hashtab.h

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
*
99
* Author : Stephen Smalley, <[email protected]>
1010
*/
11+
1112
#ifndef _SS_HASHTAB_H_
1213
#define _SS_HASHTAB_H_
1314

1415
#include <linux/types.h>
1516
#include <linux/errno.h>
1617
#include <linux/sched.h>
1718

18-
#define HASHTAB_MAX_NODES U32_MAX
19+
#define HASHTAB_MAX_NODES U32_MAX
1920

2021
struct hashtab_key_params {
21-
u32 (*hash)(const void *key); /* hash function */
22-
int (*cmp)(const void *key1, const void *key2);
23-
/* key comparison function */
22+
u32 (*hash)(const void *key); /* hash func */
23+
int (*cmp)(const void *key1, const void *key2); /* comparison func */
2424
};
2525

2626
struct hashtab_node {
@@ -30,9 +30,9 @@ struct hashtab_node {
3030
};
3131

3232
struct hashtab {
33-
struct hashtab_node **htable; /* hash table */
34-
u32 size; /* number of slots in hash table */
35-
u32 nel; /* number of elements in hash table */
33+
struct hashtab_node **htable; /* hash table */
34+
u32 size; /* number of slots in hash table */
35+
u32 nel; /* number of elements in hash table */
3636
};
3737

3838
struct hashtab_info {
@@ -48,8 +48,8 @@ struct hashtab_info {
4848
*/
4949
int hashtab_init(struct hashtab *h, u32 nel_hint);
5050

51-
int __hashtab_insert(struct hashtab *h, struct hashtab_node **dst,
52-
void *key, void *datum);
51+
int __hashtab_insert(struct hashtab *h, struct hashtab_node **dst, void *key,
52+
void *datum);
5353

5454
/*
5555
* Inserts the specified (key, datum) pair into the specified hash table.
@@ -84,8 +84,8 @@ static inline int hashtab_insert(struct hashtab *h, void *key, void *datum,
8484
cur = cur->next;
8585
}
8686

87-
return __hashtab_insert(h, prev ? &prev->next : &h->htable[hvalue],
88-
key, datum);
87+
return __hashtab_insert(h, prev ? &prev->next : &h->htable[hvalue], key,
88+
datum);
8989
}
9090

9191
/*
@@ -133,23 +133,22 @@ void hashtab_destroy(struct hashtab *h);
133133
* iterating through the hash table and will propagate the error
134134
* return to its caller.
135135
*/
136-
int hashtab_map(struct hashtab *h,
137-
int (*apply)(void *k, void *d, void *args),
136+
int hashtab_map(struct hashtab *h, int (*apply)(void *k, void *d, void *args),
138137
void *args);
139138

140139
int hashtab_duplicate(struct hashtab *new, struct hashtab *orig,
141-
int (*copy)(struct hashtab_node *new,
142-
struct hashtab_node *orig, void *args),
143-
int (*destroy)(void *k, void *d, void *args),
144-
void *args);
140+
int (*copy)(struct hashtab_node *new,
141+
struct hashtab_node *orig, void *args),
142+
int (*destroy)(void *k, void *d, void *args), void *args);
145143

146144
#ifdef CONFIG_SECURITY_SELINUX_DEBUG
147145
/* Fill info with some hash table statistics */
148146
void hashtab_stat(struct hashtab *h, struct hashtab_info *info);
149147
#else
150148
static inline void hashtab_stat(struct hashtab *h, struct hashtab_info *info)
151149
{
150+
return;
152151
}
153152
#endif
154153

155-
#endif /* _SS_HASHTAB_H */
154+
#endif /* _SS_HASHTAB_H */

0 commit comments

Comments
 (0)