Elyes Haouas has submitted this change. ( https://review.coreboot.org/c/coreboot/+/84893?usp=email )
Change subject: tree: Fix cast an object of type 'nullptr_t' to 'uintptr_t' error ......................................................................
tree: Fix cast an object of type 'nullptr_t' to 'uintptr_t' error
This to fix the error when using C23: cannot cast an object of type 'nullptr_t' to 'uintptr_t' (aka 'unsigned long') return (uintptr_t)NULL; ^
Change-Id: Ibdc8794513a508fc61a5046692f854183c36b781 Signed-off-by: Elyes Haouas ehaouas@noos.fr Reviewed-on: https://review.coreboot.org/c/coreboot/+/84893 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Jakub Czapiga czapiga@google.com --- M src/drivers/intel/fsp2_0/temp_ram_exit.c M src/lib/thread.c M src/soc/intel/apollolake/romstage.c M src/soc/intel/common/block/i2c/i2c.c M tests/lib/imd-test.c M tests/lib/imd_cbmem-test.c 6 files changed, 9 insertions(+), 9 deletions(-)
Approvals: build bot (Jenkins): Verified Jakub Czapiga: Looks good to me, approved
diff --git a/src/drivers/intel/fsp2_0/temp_ram_exit.c b/src/drivers/intel/fsp2_0/temp_ram_exit.c index 86cc216..5b8247c 100644 --- a/src/drivers/intel/fsp2_0/temp_ram_exit.c +++ b/src/drivers/intel/fsp2_0/temp_ram_exit.c @@ -29,7 +29,7 @@ temp_ram_exit = (void *)(uintptr_t)(hdr.image_base + hdr.temp_ram_exit_entry_offset); printk(BIOS_DEBUG, "Calling TempRamExit: %p\n", temp_ram_exit); if (ENV_X86_64 && CONFIG(PLATFORM_USES_FSP2_X86_32)) - status = protected_mode_call_1arg(temp_ram_exit, (uintptr_t)NULL); + status = protected_mode_call_1arg(temp_ram_exit, 0); else status = temp_ram_exit(NULL);
diff --git a/src/lib/thread.c b/src/lib/thread.c index 944c75e..8b58ca0 100644 --- a/src/lib/thread.c +++ b/src/lib/thread.c @@ -251,7 +251,7 @@
set_current_thread(t);
- t->stack_orig = (uintptr_t)NULL; /* We never free the main thread */ + t->stack_orig = 0; /* We never free the main thread */ t->id = 0; t->can_yield = 1;
diff --git a/src/soc/intel/apollolake/romstage.c b/src/soc/intel/apollolake/romstage.c index d8d11a0..2ddb07e 100644 --- a/src/soc/intel/apollolake/romstage.c +++ b/src/soc/intel/apollolake/romstage.c @@ -293,7 +293,7 @@ parse_devicetree_setting(mupd);
/* Do NOT let FSP do any GPIO pad configuration */ - mupd->FspmConfig.PreMemGpioTablePtr = (uintptr_t)NULL; + mupd->FspmConfig.PreMemGpioTablePtr = 0;
mupd->FspmConfig.SkipCseRbp = CONFIG(SKIP_CSE_RBP);
diff --git a/src/soc/intel/common/block/i2c/i2c.c b/src/soc/intel/common/block/i2c/i2c.c index 679d425..3c2f211 100644 --- a/src/soc/intel/common/block/i2c/i2c.c +++ b/src/soc/intel/common/block/i2c/i2c.c @@ -88,7 +88,7 @@ /* Find device+function for this controller */ devfn = dw_i2c_soc_bus_to_devfn(bus); if (devfn < 0) - return (uintptr_t)NULL; + return 0;
/* Form a PCI address for this device */ dev = PCI_DEV(0, PCI_SLOT(devfn), PCI_FUNC(devfn)); @@ -114,12 +114,12 @@ devfn = dw_i2c_soc_bus_to_devfn(bus);
if (devfn < 0) - return (uintptr_t)NULL; + return 0;
/* devfn -> dev */ dev = pcidev_path_on_root(devfn); if (!dev || !dev->enabled) - return (uintptr_t)NULL; + return 0;
/* dev -> bar0 */ res = probe_resource(dev, PCI_BASE_ADDRESS_0); diff --git a/tests/lib/imd-test.c b/tests/lib/imd-test.c index de42e08..b95b742 100644 --- a/tests/lib/imd-test.c +++ b/tests/lib/imd-test.c @@ -232,7 +232,7 @@ const struct imd_entry *lg_entry;
/* Fail when the limit for lg was not set. */ - imd.lg.limit = (uintptr_t)NULL; + imd.lg.limit = 0; assert_int_equal(-1, imd_recover(&imd));
/* Set the limit for lg. */ diff --git a/tests/lib/imd_cbmem-test.c b/tests/lib/imd_cbmem-test.c index 6c0ba5a..b1cca04 100644 --- a/tests/lib/imd_cbmem-test.c +++ b/tests/lib/imd_cbmem-test.c @@ -21,9 +21,9 @@
static void reset_imd(void) { - imd.lg.limit = (uintptr_t)NULL; + imd.lg.limit = 0; imd.lg.r = NULL; - imd.sm.limit = (uintptr_t)NULL; + imd.sm.limit = 0; imd.sm.r = NULL;
cbmem_initialized = 0;