[3/4] sim: dv-sockser: localize init callback

Message ID 20210424170909.5412-3-vapier@gentoo.org
State New
Headers show
Series
  • [1/4] sim: arm: move build logic to source files
Related show

Commit Message

Tankut Baris Aktemur via Gdb-patches April 24, 2021, 5:09 p.m.
Now that we don't need to hardcode the module init list in a single
place, move the dv-sockser logic to the place to the one file.
---
 sim/common/dv-sockser.c | 5 ++++-
 sim/common/dv-sockser.h | 2 --
 sim/common/sim-module.c | 4 ----
 3 files changed, 4 insertions(+), 7 deletions(-)

-- 
2.30.2

Patch

diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c
index fc552fa0acf0..73c473b15c01 100644
--- a/sim/common/dv-sockser.c
+++ b/sim/common/dv-sockser.c
@@ -222,8 +222,11 @@  dv_sockser_uninstall (SIM_DESC sd)
     }
 }
 
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern MODULE_INIT_FN sim_install_dv_sockser;
+
 SIM_RC
-dv_sockser_install (SIM_DESC sd)
+sim_install_dv_sockser (SIM_DESC sd)
 {
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
   if (sim_add_option_table (sd, NULL, sockser_options) != SIM_RC_OK)
diff --git a/sim/common/dv-sockser.h b/sim/common/dv-sockser.h
index c83ed5a9aa64..36ec0a970b15 100644
--- a/sim/common/dv-sockser.h
+++ b/sim/common/dv-sockser.h
@@ -34,8 +34,6 @@  int dv_sockser_write (SIM_DESC, unsigned char);
 int dv_sockser_write_buffer (SIM_DESC, const unsigned char *, unsigned);
 int dv_sockser_read (SIM_DESC);
 
-SIM_RC dv_sockser_install (SIM_DESC);
-
 #else
 
 /* If dv-sockser isn't available, provide stub functions.  */
diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c
index e508826922f0..efbe81696c38 100644
--- a/sim/common/sim-module.c
+++ b/sim/common/sim-module.c
@@ -60,10 +60,6 @@  static MODULE_INSTALL_FN * const early_modules[] = {
 #if WITH_HW
   sim_hw_install,
 #endif
-#ifdef HAVE_DV_SOCKSER
-  /* TODO: Shouldn't have device models here.  */
-  dv_sockser_install,
-#endif
 };
 static int early_modules_len = ARRAY_SIZE (early_modules);