Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36599 )
Change subject: arch/riscv: Make the setting of fdt calling argument more explicit ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36599/1/src/arch/riscv/boot.c File src/arch/riscv/boot.c:
https://review.coreboot.org/c/coreboot/+/36599/1/src/arch/riscv/boot.c@56 PS1, Line 56: }
Alternative flow (I'm not sure of PROG_PAYLOAD is enough; other cases?): […]
Actually, just blacklisting needs less assumptions:
void *fdt = NULL;
if (prog_cbfs_type(prog) != CBFS_TYPE_SELF && prog_cbfs_type(prog) != CBFS_TYPE_STAGE) { /* prog_entry_arg() may provide the FDT pointer. */ fdt = prog_entry_arg(prog); } if (fdt == NULL) fdt = HLS()->fdt;
OTOH, if we knew exactly that only the FIT loader uses `arg` for FDT, and will always set it != NULL, inverting the whole thing would provide the shortest version:
void *fdt = HLS()->fdt;
if (prog_cbfs_type(prog) == CBFS_TYPE_FIT) fdt = prog_entry_arg(prog);