All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: selinux@vger.kernel.org
Subject: [PATCH 10/21] selinux: fix style issues in security/selinux/ss/hashtab.h
Date: Thu, 22 Feb 2024 18:52:28 -0500	[thread overview]
Message-ID: <20240222235708.386652-33-paul@paul-moore.com> (raw)
In-Reply-To: <20240222235708.386652-23-paul@paul-moore.com>

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 <paul@paul-moore.com>
---
 security/selinux/ss/hashtab.h | 35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/security/selinux/ss/hashtab.h b/security/selinux/ss/hashtab.h
index 09b0a3744937..5f74dcc1360f 100644
--- a/security/selinux/ss/hashtab.h
+++ b/security/selinux/ss/hashtab.h
@@ -8,6 +8,7 @@
  *
  * Author : Stephen Smalley, <stephen.smalley.work@gmail.com>
  */
+
 #ifndef _SS_HASHTAB_H_
 #define _SS_HASHTAB_H_
 
@@ -15,12 +16,11 @@
 #include <linux/errno.h>
 #include <linux/sched.h>
 
-#define HASHTAB_MAX_NODES	U32_MAX
+#define HASHTAB_MAX_NODES U32_MAX
 
 struct hashtab_key_params {
-	u32 (*hash)(const void *key);	/* hash function */
-	int (*cmp)(const void *key1, const void *key2);
-					/* key comparison function */
+	u32 (*hash)(const void *key); /* hash func */
+	int (*cmp)(const void *key1, const void *key2); /* comparison func */
 };
 
 struct hashtab_node {
@@ -30,9 +30,9 @@ struct hashtab_node {
 };
 
 struct hashtab {
-	struct hashtab_node **htable;	/* hash table */
-	u32 size;			/* number of slots in hash table */
-	u32 nel;			/* number of elements in hash table */
+	struct hashtab_node **htable; /* hash table */
+	u32 size; /* number of slots in hash table */
+	u32 nel; /* number of elements in hash table */
 };
 
 struct hashtab_info {
@@ -48,8 +48,8 @@ struct hashtab_info {
  */
 int hashtab_init(struct hashtab *h, u32 nel_hint);
 
-int __hashtab_insert(struct hashtab *h, struct hashtab_node **dst,
-		     void *key, void *datum);
+int __hashtab_insert(struct hashtab *h, struct hashtab_node **dst, void *key,
+		     void *datum);
 
 /*
  * 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,
 		cur = cur->next;
 	}
 
-	return __hashtab_insert(h, prev ? &prev->next : &h->htable[hvalue],
-				key, datum);
+	return __hashtab_insert(h, prev ? &prev->next : &h->htable[hvalue], key,
+				datum);
 }
 
 /*
@@ -133,15 +133,13 @@ void hashtab_destroy(struct hashtab *h);
  * iterating through the hash table and will propagate the error
  * return to its caller.
  */
-int hashtab_map(struct hashtab *h,
-		int (*apply)(void *k, void *d, void *args),
+int hashtab_map(struct hashtab *h, int (*apply)(void *k, void *d, void *args),
 		void *args);
 
 int hashtab_duplicate(struct hashtab *new, struct hashtab *orig,
-		int (*copy)(struct hashtab_node *new,
-			struct hashtab_node *orig, void *args),
-		int (*destroy)(void *k, void *d, void *args),
-		void *args);
+		      int (*copy)(struct hashtab_node *new,
+				  struct hashtab_node *orig, void *args),
+		      int (*destroy)(void *k, void *d, void *args), void *args);
 
 #ifdef CONFIG_SECURITY_SELINUX_DEBUG
 /* Fill info with some hash table statistics */
@@ -149,7 +147,8 @@ void hashtab_stat(struct hashtab *h, struct hashtab_info *info);
 #else
 static inline void hashtab_stat(struct hashtab *h, struct hashtab_info *info)
 {
+	return;
 }
 #endif
 
-#endif	/* _SS_HASHTAB_H */
+#endif /* _SS_HASHTAB_H */
-- 
2.43.2


  parent reply	other threads:[~2024-02-22 23:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 23:52 [PATCH 00/21] selinux: fix style issues in security/selinux/ss Paul Moore
2024-02-22 23:52 ` [PATCH 01/21] selinux: fix style issues in security/selinux/ss/avtab.h Paul Moore
2024-02-22 23:52 ` [PATCH 02/21] selinux: fix style issues in security/selinux/ss/avtab.c Paul Moore
2024-02-22 23:52 ` [PATCH 03/21] selinux: fix style issues in security/selinux/ss/conditional.h Paul Moore
2024-02-22 23:52 ` [PATCH 04/21] selinux: fix style issues in security/selinux/ss/conditional.c Paul Moore
2024-02-22 23:52 ` [PATCH 05/21] selinux: fix style issues in security/selinux/ss/constraint.h Paul Moore
2024-02-22 23:52 ` [PATCH 06/21] selinux: fix style issues in security/selinux/ss/context.h Paul Moore
2024-02-22 23:52 ` [PATCH 07/21] " Paul Moore
2024-02-22 23:52 ` [PATCH 08/21] selinux: fix style issues in security/selinux/ss/ebitmap.h Paul Moore
2024-02-22 23:52 ` [PATCH 09/21] selinux: fix style issues in security/selinux/ss/ebitmap.c Paul Moore
2024-02-22 23:52 ` Paul Moore [this message]
2024-02-22 23:52 ` [PATCH 11/21] selinux: fix style issues in security/selinux/ss/hashtab.c Paul Moore
2024-02-22 23:52 ` [PATCH 12/21] selinux: fix style issues in security/selinux/ss/mls.h Paul Moore
2024-02-22 23:52 ` [PATCH 13/21] selinux: fix style issues in security/selinux/ss/mls.c Paul Moore
2024-02-22 23:52 ` [PATCH 14/21] selinux: fix style issues in security/selinux/ss/mls_types.h Paul Moore
2024-02-22 23:52 ` [PATCH 15/21] selinux: fix style issues in security/selinux/ss/policydb.h Paul Moore
2024-02-22 23:52 ` [PATCH 16/21] selinux: fix style issues in security/selinux/ss/policydb.c Paul Moore
2024-02-22 23:52 ` [PATCH 17/21] selinux: fix style issues in security/selinux/ss/services.h Paul Moore
2024-02-22 23:52 ` [PATCH 18/21] selinux: fix style issues in security/selinux/ss/sidtab.h Paul Moore
2024-02-22 23:52 ` [PATCH 19/21] selinux: fix style issues in security/selinux/ss/sidtab.c Paul Moore
2024-02-22 23:52 ` [PATCH 20/21] selinux: fix style issues in security/selinux/ss/symtab.h Paul Moore
2024-02-22 23:52 ` [PATCH 21/21] selinux: fix style issues in security/selinux/ss/symtab.c Paul Moore
2024-02-23 22:25 ` [PATCH 0/21] selinux: fix style issues in security/selinux/ss Paul Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240222235708.386652-33-paul@paul-moore.com \
    --to=paul@paul-moore.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.