[PATCH 2/2] event: Guard more of the prototypes with an EVENT check
Tom Rini
trini at konsulko.com
Tue May 19 21:10:54 CEST 2026
On Tue, May 19, 2026 at 12:28:56PM -0600, Tom Rini wrote:
> To make sure we cannot encounter the case where code is written to use
> the event framework, but EVENT is not enabled, guard most of the header
> with a build-time check. This will promote the case in question to a
> build time failure and not a runtime debug issue.
>
> Signed-off-by: Tom Rini <trini at konsulko.com>
> ---
> include/event.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/event.h b/include/event.h
> index 3ce5f992b04e..71fb14391f25 100644
> --- a/include/event.h
> +++ b/include/event.h
> @@ -308,6 +308,7 @@ static inline const char *event_spy_id(struct evspy_info *spy)
> #endif
> }
>
> +#ifdef CONFIG_EVENT
> /*
> * It seems that LTO will drop list entries if it decides they are not used,
> * although the conditions that cause this are unclear.
> @@ -348,6 +349,7 @@ static inline const char *event_spy_id(struct evspy_info *spy)
> __used ll_entry_declare(struct evspy_info_simple, \
> _type ## _3_ ## _func, \
> evspy_info) = _ESPY_REC_SIMPLE(_type, _func)
> +#endif
>
> /**
> * event_register - register a new spy
This was really my v0 of the changes, I have made this more general and
will post a v2, of what I had intended, shortly.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260519/8953512c/attachment.sig>
More information about the U-Boot
mailing list