From: Pali Rohár Date: Thu, 8 Jul 2021 18:18:59 +0000 (+0200) Subject: arm: a37xx: pci: Optimize a3700_fdt_fix_pcie_regions() when fixup offset is zero X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=cbd7ef70bc6523474cca6480364c6248a8e5b5d7;p=u-boot.git arm: a37xx: pci: Optimize a3700_fdt_fix_pcie_regions() when fixup offset is zero If fixup offset is zero then there is nothing to fix. All calculation in this case just increase addresses by value zero which results in identity. So in this case skip whole fixup re-calculation as it is not needed. This is just an optimization for special case when fix_offset is zero which skips code path which does only identity operations (meaning nothing). No functional changes. Signed-off-by: Pali Rohár Reviewed-by: Konstantin Porotchkin Reviewed-by: Stefan Roese --- diff --git a/arch/arm/mach-mvebu/armada3700/cpu.c b/arch/arm/mach-mvebu/armada3700/cpu.c index 9aec0ce9a4..7702028ba1 100644 --- a/arch/arm/mach-mvebu/armada3700/cpu.c +++ b/arch/arm/mach-mvebu/armada3700/cpu.c @@ -331,6 +331,10 @@ int a3700_fdt_fix_pcie_regions(void *blob) /* Calculate fixup offset from first child address (in last cell) */ fix_offset = base - fdt32_to_cpu(ranges[2]); + /* If fixup offset is zero then there is nothing to fix */ + if (!fix_offset) + return 0; + /* * Fix address (last cell) of each child address and each parent * address