You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2026/07/03 06:31:09 UTC
(mynewt-core) 02/06: sys/fault: Use static conf_handler registration
This is an automated email from the ASF dual-hosted git repository.
kasjer pushed a commit to branch kasjer/removeme
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit b75c81cf6bb88125ceb4dea3bbca9fd6d075ccdc
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Wed May 6 09:06:26 2026 +0200
sys/fault: Use static conf_handler registration
Now conf_handler is statically registerd at
build time.
Signed-off-by: Jerzy Kasenberg <je...@codecoup.pl>
---
sys/fault/pkg.yml | 2 ++
sys/fault/src/fault.c | 4 ----
sys/fault/src/fault_conf.c | 6 +-----
sys/fault/src/fault_priv.h | 1 -
4 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/sys/fault/pkg.yml b/sys/fault/pkg.yml
index bf5f460f6..6691fd3c1 100644
--- a/sys/fault/pkg.yml
+++ b/sys/fault/pkg.yml
@@ -32,5 +32,7 @@ pkg.deps:
pkg.deps.FAULT_CLI:
- "@apache-mynewt-core/sys/fault/fault_cli"
+pkg.whole_archive: true
+
pkg.init:
fault_init: MYNEWT_VAL(FAULT_SYSINIT_STAGE)
diff --git a/sys/fault/src/fault.c b/sys/fault/src/fault.c
index b8ff7aa1d..2a372baf2 100644
--- a/sys/fault/src/fault.c
+++ b/sys/fault/src/fault.c
@@ -345,10 +345,6 @@ fault_register_domain_priv(int domain_id, uint8_t success_delta,
void
fault_init(void)
{
- int rc;
-
- rc = fault_conf_init();
- SYSINIT_PANIC_ASSERT(rc == 0);
}
#endif /* !MYNEWT_VAL(FAULT_STUB) */
diff --git a/sys/fault/src/fault_conf.c b/sys/fault/src/fault_conf.c
index 0e00ab6ca..73773f17f 100644
--- a/sys/fault/src/fault_conf.c
+++ b/sys/fault/src/fault_conf.c
@@ -103,8 +103,4 @@ fault_conf_persist_chronic_counts(void)
return conf_save_one("fault/chronfail", buf);
}
-int
-fault_conf_init(void)
-{
- return conf_register(&fault_conf_handler);
-}
+STATIC_CONF_HANDLER(fault_conf_handler)
diff --git a/sys/fault/src/fault_priv.h b/sys/fault/src/fault_priv.h
index f0aee061e..4e10c721f 100644
--- a/sys/fault/src/fault_priv.h
+++ b/sys/fault/src/fault_priv.h
@@ -26,6 +26,5 @@
extern uint8_t fault_chronic_counts[MYNEWT_VAL(FAULT_MAX_DOMAINS)];
int fault_conf_persist_chronic_counts(void);
-int fault_conf_init(void);
#endif