Skip to content

Commit f2b5921

Browse files
init: set init_entry.dev to NULL
[PR#51217](zephyrproject-rtos#51217) changed the `init_entry` structure, but `Z_INIT_ENTRY_NAME` (called by `SYS_INIT` or `SYS_INIT_NAMED`) does not initialize all of the members of the struct, leading to errors when building with `-Werror=missing-field-initializers`. Change the macro to initialize the `dev` member to `NULL` so that all members of the struct are initialized. Signed-off-by: Paul Fagerburg <[email protected]>
1 parent 006f16d commit f2b5921

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/zephyr/init.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ struct init_entry {
154154
Z_INIT_ENTRY_SECTION(level, prio) __used __noasan \
155155
Z_INIT_ENTRY_NAME(name) = { \
156156
.init_fn = {.sys = (init_fn_)}, \
157+
.dev = NULL, \
157158
}
158159

159160
/** @} */

0 commit comments

Comments
 (0)