From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F0A7C07E96 for ; Thu, 8 Jul 2021 18:19:19 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 32A186161F for ; Thu, 8 Jul 2021 18:19:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32A186161F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 14ECB83168; Thu, 8 Jul 2021 20:19:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="KivviwX7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1921A83168; Thu, 8 Jul 2021 20:19:14 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9824F83168 for ; Thu, 8 Jul 2021 20:19:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id E8BD66161F; Thu, 8 Jul 2021 18:19:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625768346; bh=LhQPfw8FFnPEHo3cLLUuTGsiHR8G0gl8i7aZ0UpCP/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KivviwX7ZBXJtPXqf7eFJxWhll7QOzTxOpjvO5V+zf7/vDxoT46CiPxvdEhPXKTnH 5TXN81fzPmBNgM83Fzs3MQ0cZbqyV19CyYYECqDRsmvi59xXbSOzYWtARQbul7BzMG mlUiVr3HJ6oDtsaN6HMgLcP9jDAlLcx73QX8saLh5L6bK+ORTPRpH07h4razKLWjns pClWoKlk/6HV5LKluCioZFX/nIGrqcy4JIpl4eCFDSm4bMXEAvMPQC9NfoyO3byBMW T4qec2SnW/vS0i8fwlqqop15KXza2BsejwnEd0SP9mgePVqZhOHKJPGr4rY3oXdmob Dflbt5ir6LBPw== Received: by pali.im (Postfix) id 0F77FA94; Thu, 8 Jul 2021 20:19:04 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , Konstantin Porotchkin Cc: =?UTF-8?q?Marek=20Beh=C3=BAn?= , u-boot@lists.denx.de Subject: [PATCH 2/3] arm: a37xx: pci: Optimize a3700_fdt_fix_pcie_regions() when fixup offset is zero Date: Thu, 8 Jul 2021 20:18:59 +0200 Message-Id: <20210708181900.8047-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210708181900.8047-1-pali@kernel.org> References: <20210708181900.8047-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 --- arch/arm/mach-mvebu/armada3700/cpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-mvebu/armada3700/cpu.c b/arch/arm/mach-mvebu/armada3700/cpu.c index 4dd9de471b4e..64838b16c4d8 100644 --- a/arch/arm/mach-mvebu/armada3700/cpu.c +++ b/arch/arm/mach-mvebu/armada3700/cpu.c @@ -339,6 +339,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 -- 2.20.1