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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id CCFC4C64EC4 for ; Sat, 4 Mar 2023 10:41:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9767F859BA; Sat, 4 Mar 2023 11:41:18 +0100 (CET) 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="F9c56Vag"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 89859859D7; Sat, 4 Mar 2023 11:41:17 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (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 585C0859AC for ; Sat, 4 Mar 2023 11:41:15 +0100 (CET) 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: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F220C60C5F; Sat, 4 Mar 2023 10:41:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0691C433EF; Sat, 4 Mar 2023 10:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677926473; bh=SWzR0aIY+M+8bqjvnmAJBENzaMtLyrgQpY11qFZu7kw=; h=From:To:Cc:Subject:Date:From; b=F9c56VagBQ0qNdtnhpYG2VIpdgIaeDbog4PkrHfSlrO4kGDHPJ6wuYSXiTPBq5Bph pzhvx8LO/A2IW5l1ud1uy11RdbPeW3t0JqHzODTaLexgWc86ayaBSn4trHEF5Hu5WN 9+aIR9YlmohCv/8hHI80JlJoOyUOsKZbG43CSNbiA2s8WSgy1HViBw4VZWFLtf9F0H Oq7bkqIImERBIbrFHZhM9tLn6Kwv4P+ZOF2tIQ66fGbQPHfH8PaYRIIZCPbtFsrHm+ 8yyaw9BB/mGf3bAeHewsg5oPxwuoG+5bkwSDpoEXYnWUsS6/FL4HDesqn/dh8t3bKJ RlFhqo9TI/veA== Received: by pali.im (Postfix) id 757F97B3; Sat, 4 Mar 2023 11:41:11 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Tony Dinh Cc: u-boot@lists.denx.de Subject: [PATCH u-boot-mvebu] arm: mvebu: Cleanup get_boot_device() code Date: Sat, 4 Mar 2023 11:41:02 +0100 Message-Id: <20230304104102.19055-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 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.39 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.6 at phobos.denx.de X-Virus-Status: Clean Show correct information in debug() output and use correct names for variables. No functional change. Signed-off-by: Pali Rohár --- arch/arm/mach-mvebu/cpu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c index 97154aaa2a7e..018a3614d4dd 100644 --- a/arch/arm/mach-mvebu/cpu.c +++ b/arch/arm/mach-mvebu/cpu.c @@ -67,6 +67,8 @@ u32 get_boot_device(void) { u32 val; u32 boot_device; + u32 boot_err_mode; + u32 boot_err_code; /* * First check, if UART boot-mode is active. This can only @@ -74,9 +76,9 @@ u32 get_boot_device(void) * MSB marks if the UART mode is active. */ val = readl(BOOTROM_ERR_REG); - boot_device = (val & BOOTROM_ERR_MODE_MASK) >> BOOTROM_ERR_MODE_OFFS; - debug("BOOTROM_REG=0x%08x boot_device=0x%x\n", val, boot_device); - if (boot_device == BOOTROM_ERR_MODE_UART) + boot_err_mode = (val & BOOTROM_ERR_MODE_MASK) >> BOOTROM_ERR_MODE_OFFS; + debug("BOOTROM_ERR_REG=0x%08x boot_err_mode=0x%x\n", val, boot_err_mode); + if (boot_err_mode == BOOTROM_ERR_MODE_UART) return BOOT_DEVICE_UART; #ifdef CONFIG_ARMADA_38X @@ -84,8 +86,9 @@ u32 get_boot_device(void) * If the bootrom error code contains any other than zeros it's an * error condition and the bootROM has fallen back to UART boot */ - boot_device = (val & BOOTROM_ERR_CODE_MASK) >> BOOTROM_ERR_CODE_OFFS; - if (boot_device) + boot_err_code = (val & BOOTROM_ERR_CODE_MASK) >> BOOTROM_ERR_CODE_OFFS; + debug("boot_err_code=0x%x\n", boot_err_code); + if (boot_err_code) return BOOT_DEVICE_UART; #endif -- 2.20.1