Skip to content

Commit

Permalink
init: adjust the SYS_INIT dev field init to play nice with older comp…
Browse files Browse the repository at this point in the history
…ilers

Fix a build error with certain older Cadence XCC toolchains. These
are used e.g. for Intel Tiger Lake products for the audio DSP (thhe oldest
platform supported in Zephyr upstream for the audio DSP).

To keep all compilers happy, use C89 style initializers.

Error:
lib/os/p4wq.c:216: error: unknown field ‘dev’ specified in initializer
lib/os/p4wq.c:216: warning: missing braces around initializer
lib/os/p4wq.c:216: warning: (near initialization for
  ‘__init_static_init.<anonymous>’)

Compiler version XCC RG-2017.8-linux (xt-xcc version 12.0.8)

Fixes: 2438dbb ("init: add missing initialization of dev pointer
in SYS_INIT macro")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
  • Loading branch information
kv2019i authored and carlescufi committed Jan 26, 2024
1 parent 9194a93 commit 19a33c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/zephyr/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ struct init_entry {
#define SYS_INIT_NAMED(name, init_fn_, level, prio) \
static const Z_DECL_ALIGN(struct init_entry) \
Z_INIT_ENTRY_SECTION(level, prio, 0) __used __noasan \
Z_INIT_ENTRY_NAME(name) = {.init_fn = {.sys = (init_fn_)}, .dev = NULL}
Z_INIT_ENTRY_NAME(name) = {{ (init_fn_) }, { NULL } }

/** @} */

Expand Down

0 comments on commit 19a33c7

Please sign in to comment.