git: 837b7203f0c7 - main - domains: use struct domain as argument

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Fri, 26 Aug 2022 17:35:49 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=837b7203f0c7356a35d59ed903053b9df4530164

commit 837b7203f0c7356a35d59ed903053b9df4530164
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-08-26 17:35:35 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-08-26 17:35:35 +0000

    domains: use struct domain as argument
---
 sys/kern/uipc_domain.c | 10 +++-------
 sys/sys/domain.h       |  6 +++---
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c
index a3401091bda4..8c6bd93ae703 100644
--- a/sys/kern/uipc_domain.c
+++ b/sys/kern/uipc_domain.c
@@ -248,9 +248,8 @@ pr_init(struct protosw *pr)
  * XXX can't fail at this time.
  */
 void
-domain_init(void *arg)
+domain_init(struct domain *dp)
 {
-	struct domain *dp = arg;
 	struct protosw *pr;
 	int flags;
 
@@ -283,11 +282,9 @@ domain_init(void *arg)
  * XXX can't fail at this time.
  */
 void
-domain_add(void *data)
+domain_add(struct domain *dp)
 {
-	struct domain *dp;
 
-	dp = (struct domain *)data;
 	if (dp->dom_probe != NULL && (*dp->dom_probe)() != 0)
 		return;
 	atomic_set_rel_int(&dp->dom_flags, DOMF_SUPPORTED);
@@ -307,9 +304,8 @@ domain_add(void *data)
 }
 
 void
-domain_remove(void *data)
+domain_remove(struct domain *dp)
 {
-	struct domain *dp = (struct domain *)data;
 
 	if ((dp->dom_flags & DOMF_UNLOADABLE) == 0)
 		return;
diff --git a/sys/sys/domain.h b/sys/sys/domain.h
index af4dbf0be9ee..2f3a698a369d 100644
--- a/sys/sys/domain.h
+++ b/sys/sys/domain.h
@@ -77,9 +77,9 @@ struct domain {
 #ifdef _KERNEL
 extern int	domain_init_status;
 extern struct	domain *domains;
-void		domain_add(void *);
-void		domain_remove(void *);
-void		domain_init(void *);
+void		domain_add(struct domain *);
+void		domain_remove(struct domain *);
+void		domain_init(struct domain *);
 #ifdef VIMAGE
 void		vnet_domain_init(void *);
 void		vnet_domain_uninit(void *);