Change in coreboot[master]: soc/amd: Use uinptr_t over void *

Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36562 ) Change subject: soc/amd: Use uinptr_t over void * ...................................................................... soc/amd: Use uinptr_t over void * This reduces the amount casts needed and makes it easier to catch type errors. Change-Id: I24792f45a8e6d70daabd43203df88310681af875 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> --- M src/arch/x86/acpi_bert_storage.c M src/arch/x86/include/arch/bert_storage.h M src/security/memory/memory_clear.c M src/soc/amd/picasso/memmap.c M src/soc/amd/stoneyridge/memmap.c M src/soc/amd/stoneyridge/northbridge.c 6 files changed, 18 insertions(+), 18 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/36562/1 diff --git a/src/arch/x86/acpi_bert_storage.c b/src/arch/x86/acpi_bert_storage.c index 130f97a..828b0e7 100644 --- a/src/arch/x86/acpi_bert_storage.c +++ b/src/arch/x86/acpi_bert_storage.c @@ -32,7 +32,7 @@ * manage the space. */ static int bert_region_broken; -static void *bert_region_base; +static uintptr_t bert_region_base; static size_t bert_region_size; static size_t bert_region_used; @@ -49,10 +49,10 @@ return bert_region_broken ? 0 : !!bert_region_used; } -void bert_errors_region(void **start, size_t *size) +void bert_errors_region(uintptr_t *start, size_t *size) { if (bert_region_broken) { - *start = NULL; + *start = 0; *size = 0; return; } @@ -538,11 +538,11 @@ /* The region must be in memory marked as reserved. If not implemented, * skip generating the information in the region. */ -__weak void bert_reserved_region(void **start, size_t *size) +__weak void bert_reserved_region(uintptr_t *start, size_t *size) { printk(BIOS_ERR, "Error: %s not implemented. BERT region generation disabled\n", __func__); - *start = NULL; + *start = 0; *size = 0; } @@ -562,7 +562,7 @@ return; } - memset(bert_region_base, 0, bert_region_size); + memset((void *)bert_region_base, 0, bert_region_size); } RAMSTAGE_CBMEM_INIT_HOOK(bert_storage_setup) diff --git a/src/arch/x86/include/arch/bert_storage.h b/src/arch/x86/include/arch/bert_storage.h index 644f24e..f277a67 100644 --- a/src/arch/x86/include/arch/bert_storage.h +++ b/src/arch/x86/include/arch/bert_storage.h @@ -53,12 +53,12 @@ */ /* Get implementation-specific reserved area for generating BERT info */ -void bert_reserved_region(void **start, size_t *size); +void bert_reserved_region(uintptr_t *start, size_t *size); /* Get the region where BERT error structures have been constructed for * generating the ACPI table */ -void bert_errors_region(void **start, size_t *size); +void bert_errors_region(uintptr_t *start, size_t *size); /* Get amount of available storage left for error info */ size_t bert_storage_remaining(void); diff --git a/src/security/memory/memory_clear.c b/src/security/memory/memory_clear.c index 45bee91..7394f81 100644 --- a/src/security/memory/memory_clear.c +++ b/src/security/memory/memory_clear.c @@ -88,14 +88,14 @@ BM_MEM_RAM); /* Add reserved entries */ - void *baseptr = NULL; + uintptr_t baseptr = 0; size_t size = 0; /* Only skip CBMEM, as RELOCATABLE_RAMSTAGE is a requirement, no need * to separately protect stack or heap */ cbmem_get_region(&baseptr, &size); - memranges_insert(&mem, (uintptr_t)baseptr, size, BM_MEM_TABLE); + memranges_insert(&mem, baseptr, size, BM_MEM_TABLE); if (CONFIG(PLATFORM_USES_FSP1_0)) { /* Protect CBMEM pointer */ diff --git a/src/soc/amd/picasso/memmap.c b/src/soc/amd/picasso/memmap.c index c56ac5e..b1465b2 100644 --- a/src/soc/amd/picasso/memmap.c +++ b/src/soc/amd/picasso/memmap.c @@ -49,12 +49,12 @@ #define BERT_REGION_MAX_SIZE 0 #endif -void bert_reserved_region(void **start, size_t *size) +void bert_reserved_region(uintptr_t *start, size_t *size) { if (CONFIG(ACPI_BERT)) - *start = (void *)cbmem_top(); + *start = cbmem_top(); else - *start = NULL; + *start = 0; *size = BERT_REGION_MAX_SIZE; } diff --git a/src/soc/amd/stoneyridge/memmap.c b/src/soc/amd/stoneyridge/memmap.c index 8304ba3..88eafde 100644 --- a/src/soc/amd/stoneyridge/memmap.c +++ b/src/soc/amd/stoneyridge/memmap.c @@ -49,12 +49,12 @@ #define BERT_REGION_MAX_SIZE 0 #endif -void bert_reserved_region(void **start, size_t *size) +void bert_reserved_region(uintptr_t *start, size_t *size) { if (CONFIG(ACPI_BERT)) - *start = (void *)cbmem_top(); + *start = cbmem_top(); else - *start = NULL; + *start = 0; *size = BERT_REGION_MAX_SIZE; } diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c index d08722e..f873747 100644 --- a/src/soc/amd/stoneyridge/northbridge.c +++ b/src/soc/amd/stoneyridge/northbridge.c @@ -254,7 +254,7 @@ * a table with a 0-length region: * BERT: [Firmware Bug]: table invalid. */ - void *rgn; + uintptr_t rgn; size_t size; bert_errors_region(&rgn, &size); if (!rgn) { @@ -262,7 +262,7 @@ } else { current = ALIGN(current, 8); bert = (acpi_bert_t *)current; - acpi_write_bert(bert, (uintptr_t)rgn, size); + acpi_write_bert(bert, rgn, size); acpi_add_table(rsdp, (void *)current); current += bert->header.length; } -- To view, visit https://review.coreboot.org/c/coreboot/+/36562 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I24792f45a8e6d70daabd43203df88310681af875 Gerrit-Change-Number: 36562 Gerrit-PatchSet: 1 Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> Gerrit-MessageType: newchange

Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36562 ) Change subject: soc/amd: Use uinptr_t over void * ...................................................................... Patch Set 8: Code-Review+1 (3 comments) https://review.coreboot.org/c/coreboot/+/36562/8//COMMIT_MSG Commit Message: https://review.coreboot.org/c/coreboot/+/36562/8//COMMIT_MSG@7 PS8, Line 7: uinptr_t uin*t*ptr_t https://review.coreboot.org/c/coreboot/+/36562/8//COMMIT_MSG@7 PS8, Line 7: soc/amd not only soc/amd is touched, though https://review.coreboot.org/c/coreboot/+/36562/8//COMMIT_MSG@9 PS8, Line 9: amount casts amount *of* casts -- To view, visit https://review.coreboot.org/c/coreboot/+/36562 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I24792f45a8e6d70daabd43203df88310681af875 Gerrit-Change-Number: 36562 Gerrit-PatchSet: 8 Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-Comment-Date: Tue, 03 Nov 2020 23:27:12 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment

Attention is currently required from: Arthur Heymans, Felix Held. Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36562 ) Change subject: soc/amd: Use uinptr_t over void * ...................................................................... Patch Set 8: (1 comment) Patchset: PS8: Looks good, if the comments are addressed. -- To view, visit https://review.coreboot.org/c/coreboot/+/36562 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I24792f45a8e6d70daabd43203df88310681af875 Gerrit-Change-Number: 36562 Gerrit-PatchSet: 8 Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Felix Held <felix-coreboot@felixheld.de> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org> Gerrit-Attention: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Attention: Felix Held <felix-coreboot@felixheld.de> Gerrit-Comment-Date: Thu, 05 Aug 2021 19:55:19 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment

Arthur Heymans has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/36562 ) Change subject: soc/amd: Use uinptr_t over void * ...................................................................... Abandoned Not worth rebasing anymore. -- To view, visit https://review.coreboot.org/c/coreboot/+/36562 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I24792f45a8e6d70daabd43203df88310681af875 Gerrit-Change-Number: 36562 Gerrit-PatchSet: 8 Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Felix Held <felix-coreboot@felixheld.de> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org> Gerrit-MessageType: abandon
participants (3)
-
Angel Pons (Code Review)
-
Arthur Heymans (Code Review)
-
Paul Menzel (Code Review)