Skip to content

Commit b3d07cc

Browse files
ElectricalPaulChromeos LUCI
authored andcommitted
init: set init_entry.dev to NULL
[PR#51217](zephyrproject-rtos/zephyr#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. (cherry picked from commit 04611a5) Original-Signed-off-by: Paul Fagerburg <[email protected]> GitOrigin-RevId: 04611a5 Change-Id: Id6fb67679e514fc6ca7139a7eecf461fc344df3e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4427441 Commit-Queue: Keith Short <[email protected]> Tested-by: CopyBot Service Account <[email protected]> Reviewed-by: Keith Short <[email protected]> Tested-by: Keith Short <[email protected]>
1 parent a943d1e commit b3d07cc

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)