Skip to content

Commit

Permalink
device.h: fix unbalanced initializer: ({ .pm_base = (pm_),)}
Browse files Browse the repository at this point in the history
Close parentheses and braces in the reverse order they are opened.

Fixes commit f91d473 ("pm: use braces for .pm_base inside anonymous
union initializer")

I have no idea how no compiler caught this!?

I tested very carefully with two different gcc versions and one clang
version and generated binaries are strictly identical before and after
this commit. Fix the code anyway because C macros are painful enough to
debug already, so no need to add more confusion.

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb committed May 2, 2024
1 parent ea995f6 commit 2f520e9
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 @@ -934,7 +934,7 @@ __syscall int device_init(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 2f520e9

Please sign in to comment.