From 94edd9723318779e490501811a30938437a0b34d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 30 May 2025 13:28:58 -0700 Subject: [PATCH] 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 --- soc/nuvoton/npcx/common/pinctrl_soc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nuvoton/npcx/common/pinctrl_soc.h b/soc/nuvoton/npcx/common/pinctrl_soc.h index 8f03faa82b7..36d7af83194 100644 --- a/soc/nuvoton/npcx/common/pinctrl_soc.h +++ b/soc/nuvoton/npcx/common/pinctrl_soc.h @@ -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. */