Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/63964 )
Change subject: soc/amd/common/block/psp/psp_gen2: use union pspv2_mbox_command ......................................................................
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 felix-coreboot@felixheld.de Change-Id: I3757db45272f11bb47e5106ad9054c0a9ca0cd52 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63964 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Raul Rangel rrangel@chromium.org Reviewed-by: Fred Reitberger reitbergerfred@gmail.com --- M src/soc/amd/common/block/psp/psp_gen2.c 1 file changed, 3 insertions(+), 12 deletions(-)
Approvals: build bot (Jenkins): Verified Raul Rangel: Looks good to me, approved Fred Reitberger: Looks good to me, but someone else must approve
diff --git a/src/soc/amd/common/block/psp/psp_gen2.c b/src/soc/amd/common/block/psp/psp_gen2.c index cbae7a5..22e19fa 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 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 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 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;