From ecbca16bf40b3234d6b848776dc7ad2f88ebae4e Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Sat, 9 Aug 2025 09:59:33 +0200 Subject: [PATCH] tree: Replace union {0} initializers with {} for C23 compliance This change addresses GCC-15 behavior where {0} union initializers only clear the first member, leaving padding bits uninitialized. The new {} initializer ensures full union clearing as required by C23. Change-Id: I1d9b063d8bdd3d2f0b0f67e6c20eb484ff6a5cc5 Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/88732 Tested-by: build bot (Jenkins) Reviewed-by: Yidi Lin Reviewed-by: Yu-Ping Wu --- payloads/libpayload/curses/PDCurses/dos/pdcutil.c | 2 +- src/drivers/wifi/generic/acpi.c | 2 +- src/soc/mediatek/common/dp/dptx_common.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/payloads/libpayload/curses/PDCurses/dos/pdcutil.c b/payloads/libpayload/curses/PDCurses/dos/pdcutil.c index b209352a39..98df72a0d2 100644 --- a/payloads/libpayload/curses/PDCurses/dos/pdcutil.c +++ b/payloads/libpayload/curses/PDCurses/dos/pdcutil.c @@ -88,7 +88,7 @@ void setdosmemword(int offset, unsigned short w) void PDC_dpmi_int(int vector, pdc_dpmi_regs *rmregs) { - union REGPACK regs = {0}; + union REGPACK regs = {}; rmregs->w.ss = 0; rmregs->w.sp = 0; diff --git a/src/drivers/wifi/generic/acpi.c b/src/drivers/wifi/generic/acpi.c index 753492abad..fd57120594 100644 --- a/src/drivers/wifi/generic/acpi.c +++ b/src/drivers/wifi/generic/acpi.c @@ -1246,7 +1246,7 @@ static void wifi_ssdt_write_properties(const struct device *dev, const char *sco struct dsm_uuid dsm_ids[MAX_DSM_FUNCS]; /* Retrieve the SAR limits data */ - union wifi_sar_limits sar_limits = {0}; + union wifi_sar_limits sar_limits = {}; bool sar_loaded = false; if (CONFIG(USE_SAR)) { if (get_wifi_sar_limits(&sar_limits) < 0) diff --git a/src/soc/mediatek/common/dp/dptx_common.c b/src/soc/mediatek/common/dp/dptx_common.c index d6747f78bc..c2d6f5119b 100644 --- a/src/soc/mediatek/common/dp/dptx_common.c +++ b/src/soc/mediatek/common/dp/dptx_common.c @@ -356,7 +356,7 @@ static void dptx_set_tu(struct mtk_dp *mtk_dp) static void dptx_set_misc(struct mtk_dp *mtk_dp) { u8 format, depth; - union misc_t dptx_misc = { .cmisc = {0} }; + union misc_t dptx_misc = { .cmisc = {} }; format = mtk_dp->info.format; depth = mtk_dp->info.depth;