diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2022-04-29 18:42:14 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-05-02 13:56:14 +0000 |
commit | 4452400b6031aa98c8c82ebc591a618fa62f2405 (patch) | |
tree | e617784528a3a1f5cbce5a0f3eae8a49690fc5a5 /src/soc/amd | |
parent | 63e7b7064137f1854256f07a8f49b986ea944080 (diff) |
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>
Diffstat (limited to 'src/soc/amd')
-rw-r--r-- | src/soc/amd/common/block/psp/psp_gen2.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/soc/amd/common/block/psp/psp_gen2.c b/src/soc/amd/common/block/psp/psp_gen2.c index cbae7a5f5f..22e19fa4ef 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; |