Skip to content

Commit

Permalink
pm: use braces for .pm_base inside anonymous union initializer
Browse files Browse the repository at this point in the history
Fixes commit 25173f7 ("pm: device_runtime: Extend with synchronous
runtime PM")

Fixes compilation with gcc 4.2-based toolchain used by SOF for TGL
generation products. As seen in the error message below, that gcc
version requires braces for initialization of anonymous unions:

```
zephyr/soc/xtensa/intel_adsp/common/mem_window.c:62:
   error: unknown field ‘pm_base’ specified in initializer
   warning: missing braces around initializer
   warning: (near initialization for ‘__device_dts_ord_66.<anonymous>’)
```

This is a well-known and recurring issue, see past example(s) in #68118

As the Zephyr build is deterministic, I could easily verify that this
commit makes zero .obj difference (when using the Zephyr SDK).

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb authored and henrikbrixandersen committed Feb 21, 2024
1 parent 18c96b6 commit f91d473
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/zephyr/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ static inline bool z_impl_device_is_ready(const struct device *dev)
.state = (state_), \
.data = (data_), \
IF_ENABLED(CONFIG_DEVICE_DEPS, (.deps = (deps_),)) /**/ \
IF_ENABLED(CONFIG_PM_DEVICE, (.pm_base = (pm_),)) /**/ \
IF_ENABLED(CONFIG_PM_DEVICE, ({ .pm_base = (pm_),)}) /**/ \
}

/**
Expand Down

0 comments on commit f91d473

Please sign in to comment.