Commit 72a1c577 authored by Paul Moore's avatar Paul Moore
Browse files

selinux: fix style issues in security/selinux/ss/sidtab.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: default avatarPaul Moore <paul@paul-moore.com>
parent 317e0290
Loading
Loading
Loading
Loading
+19 −17
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
 *
 * Copyright (C) 2018 Red Hat, Inc.
 */

#ifndef _SS_SIDTAB_H_
#define _SS_SIDTAB_H_

@@ -39,7 +40,8 @@ union sidtab_entry_inner {
#define size_to_shift(size) ((size) == 1 ? 1 : (const_ilog2((size)-1) + 1))

#define SIDTAB_INNER_SHIFT         \
	(SIDTAB_NODE_ALLOC_SHIFT - size_to_shift(sizeof(union sidtab_entry_inner)))
	(SIDTAB_NODE_ALLOC_SHIFT - \
	 size_to_shift(sizeof(union sidtab_entry_inner)))
#define SIDTAB_INNER_ENTRIES ((size_t)1 << SIDTAB_INNER_SHIFT)
#define SIDTAB_LEAF_ENTRIES \
	(SIDTAB_NODE_ALLOC_SIZE / sizeof(struct sidtab_entry))
@@ -125,8 +127,10 @@ int sidtab_convert(struct sidtab *s, struct sidtab_convert_params *params);

void sidtab_cancel_convert(struct sidtab *s);

void sidtab_freeze_begin(struct sidtab *s, unsigned long *flags) __acquires(&s->lock);
void sidtab_freeze_end(struct sidtab *s, unsigned long *flags) __releases(&s->lock);
void sidtab_freeze_begin(struct sidtab *s, unsigned long *flags)
	__acquires(&s->lock);
void sidtab_freeze_end(struct sidtab *s, unsigned long *flags)
	__releases(&s->lock);

int sidtab_context_to_sid(struct sidtab *s, struct context *context, u32 *sid);

@@ -137,8 +141,8 @@ int sidtab_hash_stats(struct sidtab *sidtab, char *page);
#if CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE > 0
void sidtab_sid2str_put(struct sidtab *s, struct sidtab_entry *entry,
			const char *str, u32 str_len);
int sidtab_sid2str_get(struct sidtab *s, struct sidtab_entry *entry,
		       char **out, u32 *out_len);
int sidtab_sid2str_get(struct sidtab *s, struct sidtab_entry *entry, char **out,
		       u32 *out_len);
#else
static inline void sidtab_sid2str_put(struct sidtab *s,
				      struct sidtab_entry *entry,
@@ -146,13 +150,11 @@ static inline void sidtab_sid2str_put(struct sidtab *s,
{
}
static inline int sidtab_sid2str_get(struct sidtab *s,
				     struct sidtab_entry *entry,
				     char **out, u32 *out_len)
				     struct sidtab_entry *entry, char **out,
				     u32 *out_len)
{
	return -ENOENT;
}
#endif /* CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE > 0 */

#endif /* _SS_SIDTAB_H_ */