Skip to content

soc: npcx: Add __packed to flags struct in npcx_pinctrl #90888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

thughes
Copy link
Contributor

@thughes thughes commented May 30, 2025

When building with clang and CONFIG_LTO, clang warns:

soc/nuvoton/npcx/common/pinctrl_soc.h:141:4: error: field flags within
'struct npcx_pinctrl' is less aligned than 'struct (unnamed struct at
soc/nuvoton/npcx/common/./pinctrl_soc.h:128:2)' and is usually due to
'struct npcx_pinctrl' being packed, which can lead to unaligned accesses
[-Werror,-Wunaligned-access]
         } flags;
           ^

When building with clang and CONFIG_LTO, clang warns:

soc/nuvoton/npcx/common/pinctrl_soc.h:141:4: error: field flags within
'struct npcx_pinctrl' is less aligned than 'struct (unnamed struct at
soc/nuvoton/npcx/common/./pinctrl_soc.h:128:2)' and is usually due to
'struct npcx_pinctrl' being packed, which can lead to unaligned accesses
[-Werror,-Wunaligned-access]
         } flags;
           ^

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
@thughes thughes force-pushed the push-rnsonptmzqnp branch from ebac607 to a9c99d7 Compare May 30, 2025 20:31
@thughes thughes changed the title soc: npcx:: Add __packed to flags struct in npcx_pinctrl soc: npcx: Add __packed to flags struct in npcx_pinctrl May 30, 2025
Copy link

@thughes thughes marked this pull request as ready for review May 30, 2025 21:06
@github-actions github-actions bot added platform: Nuvoton NPCX Nuvoton NPCX size: XS A PR changing only a single line of code labels May 30, 2025
@fabiobaltieri fabiobaltieri added the Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. label May 30, 2025
@thughes
Copy link
Contributor Author

thughes commented Jun 2, 2025

@MulinChao @ChiHuaL I need one of you to approve this in order for it to be merged. Thanks!

@nashif nashif merged commit 94edd97 into zephyrproject-rtos:main Jun 3, 2025
33 checks passed
@thughes thughes deleted the push-rnsonptmzqnp branch June 3, 2025 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Nuvoton NPCX Nuvoton NPCX size: XS A PR changing only a single line of code Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants