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 06D7FC61DA3 for ; Tue, 21 Feb 2023 20:35:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E3CCB85BB4; Tue, 21 Feb 2023 21:25:30 +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="AfXqwUwO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C62E385AAC; Tue, 21 Feb 2023 21:24:01 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (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 A2B2785B39 for ; Tue, 21 Feb 2023 21:22:46 +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 D9F8B611E1; Tue, 21 Feb 2023 20:22:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EB61C4339B; Tue, 21 Feb 2023 20:22:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677010953; bh=n3GVFqY2at2QIHEQRAOYT+nen1VKeY8VQUUWPi4n3p4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AfXqwUwOtxd8kic6pjOKCZnkKWRWLyDIaWxqCKpXeQnPoLGkeYBD+/NDIve7iYFak ORqyRSeGjUwFykzZcpGvgA6fcFA4bDC3kP31F72aARKGHfdzGXLslwfPJAOPoxe6Ml hJG2APA+ZpCaku0f84r2NLTu0csptBTM0wHs9p4RiiQaH3XKtJ4B2xPM9XT+/6bGB2 w3T4zU5LtKPOO+D5B57n//SUQKjbgnPe1Rr0POumRrf5xonMpiYrpVbtb25gIS0PAw UXqmtiv0AROMFH3ccO5zXb+zHhg+Y3ioueH0J08QTwcpkWpcHPbjCRpR170U0OIEc0 ysct/22sJ7khQ== Received: by pali.im (Postfix) id 2FAFBA8C; Tue, 21 Feb 2023 21:22:31 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: u-boot@lists.denx.de Cc: Stefan Roese , Tony Dinh , Josua Mayer Subject: [PATCH RFC u-boot-mvebu 23/59] cmd: mvebu/bubt: Rename variable image_size to hdr_size Date: Tue, 21 Feb 2023 21:18:49 +0100 Message-Id: <20230221201925.9644-24-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230221201925.9644-1-pali@kernel.org> References: <20230221201925.9644-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.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 Variable image_size contains size of the header, not size of the whole image. Rename this variable to reflect content. Signed-off-by: Pali Rohár --- cmd/mvebu/bubt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c index df6b73c6a172..72ed87b89ec3 100644 --- a/cmd/mvebu/bubt.c +++ b/cmd/mvebu/bubt.c @@ -905,12 +905,12 @@ static int check_image_header(void) u32 offset, size; const struct a38x_main_hdr_v1 *hdr = (struct a38x_main_hdr_v1 *)get_load_addr(); - const size_t image_size = a38x_header_size(hdr); + const size_t hdr_size = a38x_header_size(hdr); - if (!image_size) + if (!hdr_size) return -ENOEXEC; - checksum = image_checksum8(hdr, image_size); + checksum = image_checksum8(hdr, hdr_size); checksum -= hdr->checksum; if (checksum != hdr->checksum) { printf("Error: Bad A38x image header checksum. 0x%x != 0x%x\n", @@ -944,7 +944,7 @@ static int check_image_header(void) #if defined(CONFIG_ARMADA_38X) static int a38x_image_is_secure(const struct a38x_main_hdr_v1 *hdr) { - u32 image_size = a38x_header_size(hdr); + const size_t hdr_size = a38x_header_size(hdr); struct a38x_opt_hdr_v1 *ohdr; u32 ohdr_size; @@ -965,7 +965,7 @@ static int a38x_image_is_secure(const struct a38x_main_hdr_v1 *hdr) break; ohdr = (struct a38x_opt_hdr_v1 *)((u8 *)ohdr + ohdr_size); - if ((u8 *)ohdr >= (u8 *)hdr + image_size) + if ((u8 *)ohdr >= (u8 *)hdr + hdr_size) break; } while (1); -- 2.20.1