Skip to content

Commit 3ec3a83

Browse files
committed
selinux: fix style issues in security/selinux/ss/ebitmap.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 05363a7 commit 3ec3a83

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

security/selinux/ss/ebitmap.h

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,25 @@
1212
*
1313
* Author : Stephen Smalley, <[email protected]>
1414
*/
15+
1516
#ifndef _SS_EBITMAP_H_
1617
#define _SS_EBITMAP_H_
1718

1819
#include <net/netlabel.h>
1920

2021
#ifdef CONFIG_64BIT
21-
#define EBITMAP_NODE_SIZE 64
22+
#define EBITMAP_NODE_SIZE 64
2223
#else
23-
#define EBITMAP_NODE_SIZE 32
24+
#define EBITMAP_NODE_SIZE 32
2425
#endif
2526

26-
#define EBITMAP_UNIT_NUMS ((EBITMAP_NODE_SIZE-sizeof(void *)-sizeof(u32))\
27-
/ sizeof(unsigned long))
28-
#define EBITMAP_UNIT_SIZE BITS_PER_LONG
29-
#define EBITMAP_SIZE (EBITMAP_UNIT_NUMS * EBITMAP_UNIT_SIZE)
30-
#define EBITMAP_BIT 1ULL
31-
#define EBITMAP_SHIFT_UNIT_SIZE(x) \
27+
#define EBITMAP_UNIT_NUMS \
28+
((EBITMAP_NODE_SIZE - sizeof(void *) - sizeof(u32)) / \
29+
sizeof(unsigned long))
30+
#define EBITMAP_UNIT_SIZE BITS_PER_LONG
31+
#define EBITMAP_SIZE (EBITMAP_UNIT_NUMS * EBITMAP_UNIT_SIZE)
32+
#define EBITMAP_BIT 1ULL
33+
#define EBITMAP_SHIFT_UNIT_SIZE(x) \
3234
(((x) >> EBITMAP_UNIT_SIZE / 2) >> EBITMAP_UNIT_SIZE / 2)
3335

3436
struct ebitmap_node {
@@ -38,8 +40,8 @@ struct ebitmap_node {
3840
};
3941

4042
struct ebitmap {
41-
struct ebitmap_node *node; /* first node in the bitmap */
42-
u32 highbit; /* highest position in the total bitmap */
43+
struct ebitmap_node *node; /* first node in the bitmap */
44+
u32 highbit; /* highest position in the total bitmap */
4345
};
4446

4547
#define ebitmap_length(e) ((e)->highbit)
@@ -80,9 +82,9 @@ static inline unsigned int ebitmap_next_positive(const struct ebitmap *e,
8082
return ebitmap_length(e);
8183
}
8284

83-
#define EBITMAP_NODE_INDEX(node, bit) \
85+
#define EBITMAP_NODE_INDEX(node, bit) \
8486
(((bit) - (node)->startbit) / EBITMAP_UNIT_SIZE)
85-
#define EBITMAP_NODE_OFFSET(node, bit) \
87+
#define EBITMAP_NODE_OFFSET(node, bit) \
8688
(((bit) - (node)->startbit) % EBITMAP_UNIT_SIZE)
8789

8890
static inline int ebitmap_node_get_bit(const struct ebitmap_node *n,
@@ -117,15 +119,17 @@ static inline void ebitmap_node_clr_bit(struct ebitmap_node *n,
117119
n->maps[index] &= ~(EBITMAP_BIT << ofs);
118120
}
119121

120-
#define ebitmap_for_each_positive_bit(e, n, bit) \
121-
for ((bit) = ebitmap_start_positive(e, &(n)); \
122-
(bit) < ebitmap_length(e); \
123-
(bit) = ebitmap_next_positive(e, &(n), bit)) \
122+
#define ebitmap_for_each_positive_bit(e, n, bit) \
123+
for ((bit) = ebitmap_start_positive(e, &(n)); \
124+
(bit) < ebitmap_length(e); \
125+
(bit) = ebitmap_next_positive(e, &(n), bit))
124126

125127
int ebitmap_cmp(const struct ebitmap *e1, const struct ebitmap *e2);
126128
int ebitmap_cpy(struct ebitmap *dst, const struct ebitmap *src);
127-
int ebitmap_and(struct ebitmap *dst, const struct ebitmap *e1, const struct ebitmap *e2);
128-
int ebitmap_contains(const struct ebitmap *e1, const struct ebitmap *e2, u32 last_e2bit);
129+
int ebitmap_and(struct ebitmap *dst, const struct ebitmap *e1,
130+
const struct ebitmap *e2);
131+
int ebitmap_contains(const struct ebitmap *e1, const struct ebitmap *e2,
132+
u32 last_e2bit);
129133
int ebitmap_get_bit(const struct ebitmap *e, unsigned long bit);
130134
int ebitmap_set_bit(struct ebitmap *e, unsigned long bit, int value);
131135
void ebitmap_destroy(struct ebitmap *e);
@@ -151,4 +155,4 @@ static inline int ebitmap_netlbl_import(struct ebitmap *ebmap,
151155
}
152156
#endif
153157

154-
#endif /* _SS_EBITMAP_H_ */
158+
#endif /* _SS_EBITMAP_H_ */

0 commit comments

Comments
 (0)