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 45EBFEB64DB for ; Mon, 19 Jun 2023 15:09:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5AA478613D; Mon, 19 Jun 2023 17:09:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com 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=ti.com header.i=@ti.com header.b="TgK9QGUj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9019285362; Mon, 19 Jun 2023 17:08:50 +0200 (CEST) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (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 29DB58636A for ; Mon, 19 Jun 2023 17:07:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=devarsht@ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 35J9xFbc021060; Mon, 19 Jun 2023 04:59:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1687168755; bh=qgYinIkN97WY4DKpH06pDF/jXNiZTH1LSHi1XEOpwLA=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=TgK9QGUj1BkgRmMcDGq/1lh3OgpXX1/xIT47JqxG6wNS8/PzUIoURN8RCrK18R5Q0 pwWpcH4VF9/JOqj13CAiXnBmoaBXJONd6xrmXJB6jcN4dB53kB28w/OzNWQWs2KNnK ODwjBgys93J+LZaxg0RLaPuh652LBKLvt2Qh9vl4= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 35J9xFuj127326 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 19 Jun 2023 04:59:15 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 19 Jun 2023 04:59:15 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 19 Jun 2023 04:59:15 -0500 Received: from [172.24.145.199] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 35J9xCwV069862; Mon, 19 Jun 2023 04:59:13 -0500 Message-ID: Date: Mon, 19 Jun 2023 15:29:12 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 2/2] common: splash_source: Fix type casting errors. Content-Language: en-US To: Nikhil M Jain , CC: , , , References: <20230619094403.83585-1-n-jain1@ti.com> <20230619094403.83585-3-n-jain1@ti.com> From: Devarsh Thakkar In-Reply-To: <20230619094403.83585-3-n-jain1@ti.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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.8 at phobos.denx.de X-Virus-Status: Clean Hi Nikhil, On 19/06/23 15:14, Nikhil M Jain wrote: > During compilation splash_source puts out below warning for type > conversion in splash_load_fit for bmp_load_addr and fit_header, Below should be separate sentence. Also remove fullstop from subject line. change > their type to uintptr_t to mitigate the warnings. s/mitigate/fix > > common/splash_source.c: In function ‘splash_load_fit’: > common/splash_source.c:366:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > 366 | img_header = (struct legacy_img_hdr *)bmp_load_addr; > | ^ > common/splash_source.c:376:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] > 376 | res = splash_storage_read_raw(location, (u32)fit_header, fit_size); > | ^ > common/splash_source.c:401:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > 401 | memmove((void *)bmp_load_addr, internal_splash_data, internal_splash_size); > > Signed-off-by: Nikhil M Jain > --- > common/splash_source.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/common/splash_source.c b/common/splash_source.c > index a260137619..53f2c7034b 100644 > --- a/common/splash_source.c > +++ b/common/splash_source.c > @@ -343,7 +343,7 @@ static struct splash_location *select_splash_location( > } > > #ifdef CONFIG_FIT > -static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr) > +static int splash_load_fit(struct splash_location *location, uintptr_t bmp_load_addr) > { > int res; > int node_offset; > @@ -373,7 +373,7 @@ static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr) > In my opinion better to use uintptr_t for bmp_load_addr or for the matter any other address being used at all places in splash files. Regards Devarsh > /* Read in entire FIT */ > fit_header = (const u32 *)(bmp_load_addr + header_size); > - res = splash_storage_read_raw(location, (u32)fit_header, fit_size); > + res = splash_storage_read_raw(location, (uintptr_t)fit_header, fit_size); > if (res < 0) > return res; >