From 4452400b6031aa98c8c82ebc591a618fa62f2405 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Fri, 29 Apr 2022 18:42:14 +0200 Subject: soc/amd/common/block/psp/psp_gen2: use union pspv2_mbox_command Don't use unnamed redefinitions of the pspv2_mbox_command union when the union definition can be used instead. Signed-off-by: Felix Held Change-Id: I3757db45272f11bb47e5106ad9054c0a9ca0cd52 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63964 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel Reviewed-by: Fred Reitberger --- src/soc/amd/common/block/psp/psp_gen2.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/soc/amd/common') diff --git a/src/soc/amd/common/block/psp/psp_gen2.c b/src/soc/amd/common/block/psp/psp_gen2.c index cbae7a5f5f64..22e19fa4efc3 100644 --- a/src/soc/amd/common/block/psp/psp_gen2.c +++ b/src/soc/amd/common/block/psp/psp_gen2.c @@ -46,10 +46,7 @@ static void *soc_get_mbox_address(void) static u16 rd_mbox_sts(struct pspv2_mbox *mbox) { - union { - u32 val; - struct pspv2_mbox_cmd_fields fields; - } tmp = { 0 }; + union pspv2_mbox_command tmp = { .val = 0 }; tmp.val = read32(&mbox->command); return tmp.fields.mbox_status; @@ -57,10 +54,7 @@ static u16 rd_mbox_sts(struct pspv2_mbox *mbox) static void wr_mbox_cmd(struct pspv2_mbox *mbox, u8 cmd) { - union { - u32 val; - struct pspv2_mbox_cmd_fields fields; - } tmp = { 0 }; + union pspv2_mbox_command tmp = { .val = 0 }; /* Write entire 32-bit area to begin command execution */ tmp.fields.mbox_command = cmd; @@ -69,10 +63,7 @@ static void wr_mbox_cmd(struct pspv2_mbox *mbox, u8 cmd) static u8 rd_mbox_recovery(struct pspv2_mbox *mbox) { - union { - u32 val; - struct pspv2_mbox_cmd_fields fields; - } tmp = { 0 }; + union pspv2_mbox_command tmp = { .val = 0 }; tmp.val = read32(&mbox->command); return !!tmp.fields.recovery; -- cgit v1.2.3