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 <ovpan...@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

Reply via email to