soc: npcx: Add __packed to flags struct in npcx_pinctrl

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>
This commit is contained in:
Tom Hughes 2025-05-30 13:28:58 -07:00 committed by Anas Nashif
commit 94edd97233

View file

@ -125,7 +125,7 @@ struct npcx_pinctrl {
struct npcx_psl_input psl_in;
uint16_t cfg_word;
} cfg;
struct {
struct __packed {
/** Indicates the current pinctrl type. */
enum npcx_pinctrl_type type :2;
/** Properties used for pinmuxing. */