[PATCH 1/2] event: remove CONFIG_EVENT_DYNAMIC check in event_register()

Ovidiu Panait ovpanait at gmail.com
Sun May 15 20:40:28 CEST 2022


The whole event_register() function is wrapped in EVENT_DYNAMIC #ifdef
checks, so the inner check is not needed:

 #if CONFIG_IS_ENABLED(EVENT_DYNAMIC)
 ...
 int event_register(...)
 {
     ...
     if (!CONFIG_IS_ENABLED(EVENT_DYNAMIC))
         return -ENOSYS;
 }
 #endif

Signed-off-by: Ovidiu Panait <ovpanait at gmail.com>
---

 common/event.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/common/event.c b/common/event.c
index 9d67a060a0..063647447d 100644
--- a/common/event.c
+++ b/common/event.c
@@ -159,8 +159,6 @@ int event_register(const char *id, enum event_t type, event_handler_t func, void
 	struct event_state *state = gd_event_state();
 	struct event_spy *spy;
 
-	if (!CONFIG_IS_ENABLED(EVENT_DYNAMIC))
-		return -ENOSYS;
 	spy = malloc(sizeof(*spy));
 	if (!spy)
 		return log_msg_ret("alloc", -ENOMEM);
-- 
2.25.1



More information about the U-Boot mailing list