The function 'check_partial_fdt()' performs an explicit check for the FDT magic number (FDT_MAGIC) before calling 'fdt_check_header(). This check is redundant, because 'fdt_check_header()' includes checking the magic number.
Remove the redundant check to simplify the code and rely on the library function to perform header validation. Signed-off-by: Dmytro Prokopchuk <[email protected]> --- xen/common/device-tree/dom0less-build.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c index 9fd004c42a..2600350a3c 100644 --- a/xen/common/device-tree/dom0less-build.c +++ b/xen/common/device-tree/dom0less-build.c @@ -359,12 +359,6 @@ static int __init check_partial_fdt(void *pfdt, size_t size) { int res; - if ( fdt_magic(pfdt) != FDT_MAGIC ) - { - dprintk(XENLOG_ERR, "Partial FDT is not a valid Flat Device Tree"); - return -EINVAL; - } - res = fdt_check_header(pfdt); if ( res ) { -- 2.43.0
