git: 93451769fc6e - main - asmc: make asmc_sysctl_add_system() void

From: Abdelkader Boudih <seuros_at_FreeBSD.org>
Date: Sun, 15 Nov 2026 21:21:58 UTC
The branch main has been updated by seuros:

URL: https://cgit.FreeBSD.org/src/commit/?id=93451769fc6eae77ed3cfb0f6f508ca82e9eab96

commit 93451769fc6eae77ed3cfb0f6f508ca82e9eab96
Author:     Abdelkader Boudih <seuros@FreeBSD.org>
AuthorDate: 2026-11-15 21:12:57 +0000
Commit:     Abdelkader Boudih <seuros@FreeBSD.org>
CommitDate: 2026-11-15 21:12:57 +0000

    asmc: make asmc_sysctl_add_system() void
    
    Its only caller already discarded the return value with (void). Match
    the other sysctl subtree builders.
    
    Reviewed by:    adrian
    
    Differential Revision:  https://reviews.freebsd.org/D61537
---
 sys/dev/asmc/asmc.c        | 2 +-
 sys/dev/asmc/asmc_sysctl.c | 6 ++----
 sys/dev/asmc/asmc_sysctl.h | 6 +++---
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c
index 03d5bb920bb0..edff84428607 100644
--- a/sys/dev/asmc/asmc.c
+++ b/sys/dev/asmc/asmc.c
@@ -281,7 +281,7 @@ asmc_attach(device_t dev)
 		    asmc_shutdown, dev, SHUTDOWN_PRI_FIRST);
 
 	/* System state / board identity subtree. */
-	(void)asmc_sysctl_add_system(dev, sysctlctx);
+	asmc_sysctl_add_system(dev, sysctlctx);
 
 	if (!sc->sc_has_sms)
 		goto nosms;
diff --git a/sys/dev/asmc/asmc_sysctl.c b/sys/dev/asmc/asmc_sysctl.c
index ff562eb76894..8a5df89f5d9b 100644
--- a/sys/dev/asmc/asmc_sysctl.c
+++ b/sys/dev/asmc/asmc_sysctl.c
@@ -542,7 +542,7 @@ static const struct {
 	    "IU", CTLTYPE_UINT | CTLFLAG_RD, 0, asmc_rgen_sysctl, 0, 0 },
 };
 
-int
+void
 asmc_sysctl_add_system(device_t dev, struct sysctl_ctx_list *ctx)
 {
 	struct sysctl_oid *sys_tree;
@@ -553,7 +553,7 @@ asmc_sysctl_add_system(device_t dev, struct sysctl_ctx_list *ctx)
 	    "System state and board identity");
 	if (sys_tree == NULL) {
 		device_printf(dev, "failed to create system sysctl node\n");
-		return (ENXIO);
+		return;
 	}
 
 	for (unsigned int k = 0; k < nitems(asmc_system_sysctls); k++) {
@@ -576,8 +576,6 @@ asmc_sysctl_add_system(device_t dev, struct sysctl_ctx_list *ctx)
 		    asmc_system_sysctls[k].fmt,
 		    asmc_system_sysctls[k].desc, NULL);
 	}
-
-	return (0);
 }
 
 /* Platform toggles under dev.asmc.n, each present only if its key reads. */
diff --git a/sys/dev/asmc/asmc_sysctl.h b/sys/dev/asmc/asmc_sysctl.h
index 5fd7bd93eac4..4690d5801fc4 100644
--- a/sys/dev/asmc/asmc_sysctl.h
+++ b/sys/dev/asmc/asmc_sysctl.h
@@ -9,14 +9,14 @@
 
 /*
  * Sysctl subtree builders, one per dev.asmc.N node.  asmc_attach() calls these
- * in registration order; only add_system can fail, and only because the key
- * count it reads is what tells the rest of the driver the SMC is there.
+ * in registration order; a node that fails to create just leaves that subtree
+ * missing, so none of these are fatal to attach.
  */
 void	asmc_sysctl_add_fan(device_t dev, struct sysctl_ctx_list *ctx);
 void	asmc_sysctl_add_temp(device_t dev, struct sysctl_ctx_list *ctx);
 void	asmc_sysctl_add_light(device_t dev, struct sysctl_ctx_list *ctx);
 void	asmc_sysctl_add_sms(device_t dev, struct sysctl_ctx_list *ctx);
-int	asmc_sysctl_add_system(device_t dev, struct sysctl_ctx_list *ctx);
+void	asmc_sysctl_add_system(device_t dev, struct sysctl_ctx_list *ctx);
 void	asmc_sysctl_add_platform(device_t dev, struct sysctl_ctx_list *ctx);
 
 /* Registered by the core's sensor range scan, one OID per detected key. */