From patchwork Sat Mar 7 09:53:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1250858 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=gmx.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=MrLAh3nu; dkim-atps=neutral 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48ZKb04VbZz9sNg for ; Sat, 7 Mar 2020 20:54:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD51280857; Sat, 7 Mar 2020 10:54:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="MrLAh3nu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2028880D3F; Sat, 7 Mar 2020 10:54:07 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DD00E80140 for ; Sat, 7 Mar 2020 10:54:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1583574833; bh=s2Tg+uAHut3KKRedHZlh5XFA8D9k98ETDIstLKs96+U=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=MrLAh3nu8Naw2cZoDcucVsJcs9ft0ucSFRoSVZvaLqO2fC1U6+jq0lJBBAJ8hxdy1 JFCac27auLDed+26iSrLYqg3OxJXcGmWvboiAiVrB44ud0fH5EwEjRp6i11MW2agFf gVmrgwRu6tw8NogRuqp5AKUZVmO1us3XENhem3Xs= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([84.119.33.226]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MEm27-1j7So73fRb-00GI7A; Sat, 07 Mar 2020 10:53:53 +0100 From: Heinrich Schuchardt To: Tom Rini Cc: Eugeniu Rosca , Sam Protsenko , Lokesh Vutla , Joe Hershberger , Simon Glass , Roman Stratiienko , Philippe Reynes , Julius Werner , Bin Meng , AKASHI Takahiro , Alex Kiernan , Chris Packham , Masahiro Yamada , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH v2 1/1] image.h: use uint32_t instead of u32 in android_image_get_dtb* Date: Sat, 7 Mar 2020 10:53:44 +0100 Message-Id: <20200307095344.9016-1-xypron.glpk@gmx.de> X-Mailer: git-send-email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JsCr0oqBzS8M8XF2cJC9A/xBpQHgxcMquLRNesh8+SYOrk 18HOWGIfPWEXaPcbDXIw0wsWhnz6DuBvwiGte9Q4CtL38ifw85uTSmkGH/FImvVvfLir1oKv/ ZpxIs2XJxtTjuVwkZtQMruKBeRI7F5MfL7Jc/SXayqhZGRC66dVDyCtFUYFyryN7MGn/V7ZS8 0WryOHDyVybl6yQEaFCFLVfXkZ9qaLPGV3zRyo0iEan6qDM7Na3O/E4ydDCm0wsSCg92vvG5F 2Fph+oRFL34dQ/hqMwr7JCUqMU3qX+sfbfbvOaQwRXttjWA+JnusLlv31I8gGw2Go9Qvh8mHb Ao5foUEwjRp+7rXYu+Cy424vFM17VfzcXhhD3aLztl7vxBBmIY3n3UPaEaa+OCZdOADWYUVvt Ir+t9+QhKMyWXUUUmD+olIv6d+Zg6KCU9Np4CwHbTtudhKSiV/H0OXf6TDqhgSoQQhC9vXHGP jg9nZEhsqGtTG27+M 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.2 at phobos.denx.de X-Virus-Status: Clean From: Eugeniu Rosca 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 Change the function parameters in the implementation to match the declaration in the header. Signed-off-by: Heinrich Schuchardt --- v2: Change the function parameters in the implementation to match the declaration in the header. --- common/image-android.c | 6 +++--- include/image.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/common/image-android.c b/common/image-android.c index 6af9baa121..3c3600b6f9 100644 --- a/common/image-android.c +++ b/common/image-android.c @@ -216,7 +216,7 @@ int android_image_get_second(const struct andr_img_hdr *hdr, * * Return: true on success or false on error. */ -bool android_image_get_dtbo(ulong hdr_addr, ulong *addr, u32 *size) +bool android_image_get_dtbo(ulong hdr_addr, ulong *addr, uint32_t *size) { const struct andr_img_hdr *hdr; ulong dtbo_img_addr; @@ -317,8 +317,8 @@ exit: * * Return: true on success or false on error. */ -bool android_image_get_dtb_by_index(ulong hdr_addr, u32 index, ulong *addr, - u32 *size) +bool android_image_get_dtb_by_index(ulong hdr_addr, uint32_t index, ulong *addr, + uint32_t *size) { const struct andr_img_hdr *hdr; bool res; diff --git a/include/image.h b/include/image.h index b316d167d8..1341fbed62 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);