]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
event: remove CONFIG_EVENT_DYNAMIC check in event_register()
authorOvidiu Panait <ovpanait@gmail.com>
Sun, 15 May 2022 18:40:28 +0000 (21:40 +0300)
committerTom Rini <trini@konsulko.com>
Mon, 6 Jun 2022 21:47:17 +0000 (17:47 -0400)
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@gmail.com>
common/event.c

index 9d67a060a021f73763a3dbc75b9c44602446ba75..063647447d546820f4a61857367483de9f4d366b 100644 (file)
@@ -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);