From patchwork Mon Feb 17 10:23:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniu Rosca X-Patchwork-Id: 1239098 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=de.adit-jv.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Lg8L6r5Gz9sP7 for ; Mon, 17 Feb 2020 21:24:34 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D96FE8122B; Mon, 17 Feb 2020 11:24:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=de.adit-jv.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id D114281267; Mon, 17 Feb 2020 11:24:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SUBJ_OBFU_PUNCT_FEW,SUBJ_OBFU_PUNCT_MANY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from smtp1.de.adit-jv.com (smtp1.de.adit-jv.com [93.241.18.167]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C34708079C for ; Mon, 17 Feb 2020 11:24:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=de.adit-jv.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=erosca@de.adit-jv.com Received: from localhost (smtp1.de.adit-jv.com [127.0.0.1]) by smtp1.de.adit-jv.com (Postfix) with ESMTP id 6F02A3C0579; Mon, 17 Feb 2020 11:24:22 +0100 (CET) Received: from smtp1.de.adit-jv.com ([127.0.0.1]) by localhost (smtp1.de.adit-jv.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H6nVks-IrXVa; Mon, 17 Feb 2020 11:24:13 +0100 (CET) Received: from HI2EXCH01.adit-jv.com (hi2exch01.adit-jv.com [10.72.92.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.de.adit-jv.com (Postfix) with ESMTPS id D386C3C04C1; Mon, 17 Feb 2020 11:24:13 +0100 (CET) Received: from lxhi-065.adit-jv.com (10.72.93.66) by HI2EXCH01.adit-jv.com (10.72.92.24) with Microsoft SMTP Server (TLS) id 14.3.468.0; Mon, 17 Feb 2020 11:24:13 +0100 From: Eugeniu Rosca To: , Tom Rini CC: Eugeniu Rosca , Eugeniu Rosca , Sam Protsenko , Masahiro Yamada Subject: [PATCH] image.h: use uint32_t instead of u32 in android_image_get_dtb* Date: Mon, 17 Feb 2020 11:23:53 +0100 Message-ID: <20200217102353.11174-1-erosca@de.adit-jv.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-Originating-IP: [10.72.93.66] X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.1 at phobos.denx.de X-Virus-Status: Clean Replace 'u32' by 'uint32_t' in image.h, since the former may lead to build failures in U-Boot tooling (see [1]). Avoid using 'uint', since it is not a fixed-width type [2], potentially leading to a dangerous mismatch between the prototypes and definitions of the android_image_get_dtb* functions. This should be the quickest way to overcome the tooling build failure, with more future-proof solutions being proposed by Yamada-san in [1]. [1] https://patchwork.ozlabs.org/patch/1238245/ [2] Excerpt from https://en.cppreference.com/w/cpp/language/types -----------8<------------ Type specifier Width in bits by data model LP32 ILP32 LLP64 LP64 unsigned int 16 32 32 32 -----------8<------------ Cc: Tom Rini Cc: Sam Protsenko Fixes: 7f2531502c74c0 ("image: android: Add routine to get dtbo params") Fixes: c3bfad825a71ea ("image: android: Add functions for handling dtb field") Suggested-by: Masahiro Yamada Signed-off-by: Eugeniu Rosca Reviewed-by: Masahiro Yamada Reviewed-by: Sam Protsenko --- include/image.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/image.h b/include/image.h index b316d167d8d7..1341fbed62ba 100644 --- a/include/image.h +++ b/include/image.h @@ -1425,9 +1425,9 @@ int android_image_get_ramdisk(const struct andr_img_hdr *hdr, ulong *rd_data, ulong *rd_len); int android_image_get_second(const struct andr_img_hdr *hdr, ulong *second_data, ulong *second_len); -bool android_image_get_dtbo(ulong hdr_addr, ulong *addr, u32 *size); -bool android_image_get_dtb_by_index(ulong hdr_addr, u32 index, ulong *addr, - u32 *size); +bool android_image_get_dtbo(ulong hdr_addr, ulong *addr, uint32_t *size); +bool android_image_get_dtb_by_index(ulong hdr_addr, uint32_t index, ulong *addr, + uint32_t *size); ulong android_image_get_end(const struct andr_img_hdr *hdr); ulong android_image_get_kload(const struct andr_img_hdr *hdr); ulong android_image_get_kcomp(const struct andr_img_hdr *hdr);