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 D1376ECAAA2 for ; Sun, 28 Aug 2022 18:33:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8CA87848F2; Sun, 28 Aug 2022 20:33:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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; unprotected) header.d=chromium.org header.i=@chromium.org header.b="PU8QO4qS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E6F8F8492D; Sun, 28 Aug 2022 20:33:16 +0200 (CEST) Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2E8AD845BE for ; Sun, 28 Aug 2022 20:33:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-11e9a7135easo5654374fac.6 for ; Sun, 28 Aug 2022 11:33:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=6r4sYAfsj+hw7xCOGW4lU8LHqMSF60DcHNA+ykBvjwQ=; b=PU8QO4qSDC2CuKNNi32cSJN9tKC8LJ7sehvJwmrV1flZxEhDHOEqbu0N36zNWNjp5Q 1TGZZm0ZxxzZHcNap90qLpy8tmVH0iPhqui8LopRx4ZkmIHPj274OgbWrJV2xWcbXqdU BtzHPLKuntPYki40kkBWMPptWtzIRH4eSvOUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=6r4sYAfsj+hw7xCOGW4lU8LHqMSF60DcHNA+ykBvjwQ=; b=uiKfBjaGNi+GzHpL15e+650riven3ONoan5SV5pcNC4kaZQFjpZ7YrYww9jC5BFdDt O8Kz5AV8t0N3+7nbcBVUkVUncMzeztd+GmHdWYRdy+IJeBPu/phWG2Ey5r+XE88mKiAG E9rIAd7k+7FYZNRQb9pIMOLbC4LfLjC10iXXCm5nkJ9sqMXW2eZN+ws529em+kKRJPN/ tEYDEM/3kV+v9fu1zHTfU7KSW6oxndJ114tIsXXi3A8OIyj9YcFAJygQlP4YjsWACGuE Yrp1MNabeD2EoT/KpYctJGu4Rz95oibppoMVejl30gEmWdcYo0sQuHh8gx2+WpibWk7/ nBCg== X-Gm-Message-State: ACgBeo2aa/PMtZ0kbJOMB/U+iRvn+zi9RWTo/Y9cIgD2A386m2J0xRwy euyVKdpZwlKe6b+Bpm14gxvrRXoLh9o1ZQ== X-Google-Smtp-Source: AA6agR7n6qxE4fz+PHfm1J00QFWaylCMQhiUylL4lazJF3KyxyvlEqjUbJLo0E9aKM3JkhZ/PprSPg== X-Received: by 2002:a05:6870:700f:b0:11c:fb0c:693 with SMTP id u15-20020a056870700f00b0011cfb0c0693mr6152027oae.129.1661711589846; Sun, 28 Aug 2022 11:33:09 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id 91-20020a9d0de4000000b006339b36127dsm4299771ots.3.2022.08.28.11.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Aug 2022 11:33:09 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Neil Armstrong , Simon Glass , Alexandru Gagniuc , Artem Lapkin , Joe Hershberger , Leo Yu-Chi Liang , Marek Vasut , Michal Simek Subject: [PATCH 1/8] image: Fix up ANDROID_BOOT_IMAGE ramdisk code Date: Sun, 28 Aug 2022 12:32:46 -0600 Message-Id: <20220828183253.822815-2-sjg@chromium.org> X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog In-Reply-To: <20220828183253.822815-1-sjg@chromium.org> References: <20220828183253.822815-1-sjg@chromium.org> MIME-Version: 1.0 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 Convert this to an if(), fix the cast from an address to a pointer and make sure that any error is returned correctly. Signed-off-by: Simon Glass --- boot/image-board.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/boot/image-board.c b/boot/image-board.c index 4e4d1c157d7..14b595977e1 100644 --- a/boot/image-board.c +++ b/boot/image-board.c @@ -421,12 +421,19 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch, images->fit_noffset_rd = rd_noffset; break; #endif -#ifdef CONFIG_ANDROID_BOOT_IMAGE case IMAGE_FORMAT_ANDROID: - android_image_get_ramdisk((void *)images->os.start, - rd_datap, rd_lenp); - break; -#endif + if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE)) { + void *ptr = map_sysmem(images->os.start, 0); + int ret; + + ret = android_image_get_ramdisk(ptr, rd_datap, + rd_lenp); + unmap_sysmem(ptr); + if (ret) + return ret; + break; + } + fallthrough; default: if (IS_ENABLED(CONFIG_SUPPORT_RAW_INITRD)) { char *end = NULL; -- 2.37.2.672.g94769d06f0-goog