From patchwork Sun Jan 3 13:56:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11995739 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 596F3C433E0 for ; Sun, 3 Jan 2021 13:57:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2ADD620B1F for ; Sun, 3 Jan 2021 13:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726688AbhACN5N (ORCPT ); Sun, 3 Jan 2021 08:57:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:35096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbhACN5N (ORCPT ); Sun, 3 Jan 2021 08:57:13 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CB7E9208C7; Sun, 3 Jan 2021 13:56:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609682192; bh=/ukaI8TKo+cDOQeZ82bimBKorxyRnnfYUNmKR5e2BRw=; h=From:To:Cc:Subject:Date:From; b=Ps595AIpuc4iWk4cw5FK1zOO8MgStHLU1lL3uDXmXmf8RmzDX1cARZU0cBVLORyNG gLzb8uGC5NJOL0oBbghHW8TQwBTUl+cvF8pKJb9vmrXII3p7ie/Mp2WfpVyyTHwEAA ouxdfn9LH7NZYKOHx1EJrGSW1YboAUy4cWbb4T4i2CztIMZpwibOd7PgH1h87j5rPv +gRUNZizOXALFIlDMrXUlTxC8btcrWeYLvbZlu9XDjr7CYRQwNjCXdsjKKNfkIb79x QHFol/jd2ut0EA8+TyRjqqF51VwCGlYhyZBEYb/lUoXaDw9OYC0F2Ko1N5cIx0y9+O 4yE5Yxgrr2wyQ== From: Arnd Bergmann To: Andy Gross , Bjorn Andersson , Ohad Ben-Cohen , Mathieu Poirier , Vinod Koul Cc: Arnd Bergmann , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] remoteproc: qcom: pil_info: avoid 64-bit division Date: Sun, 3 Jan 2021 14:56:12 +0100 Message-Id: <20210103135628.3702427-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Arnd Bergmann On 32-bit machines with 64-bit resource_size_t, the driver causes a link failure because of the 64-bit division: arm-linux-gnueabi-ld: drivers/remoteproc/qcom_pil_info.o: in function `qcom_pil_info_store': qcom_pil_info.c:(.text+0x1ec): undefined reference to `__aeabi_uldivmod' Add a cast to an u32 to avoid this. If the resource exceeds 4GB, there are bigger problems. Fixes: 549b67da660d ("remoteproc: qcom: Introduce helper to store pil info in IMEM") Signed-off-by: Arnd Bergmann --- drivers/remoteproc/qcom_pil_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/qcom_pil_info.c b/drivers/remoteproc/qcom_pil_info.c index 5521c4437ffa..7c007dd7b200 100644 --- a/drivers/remoteproc/qcom_pil_info.c +++ b/drivers/remoteproc/qcom_pil_info.c @@ -56,7 +56,7 @@ static int qcom_pil_info_init(void) memset_io(base, 0, resource_size(&imem)); _reloc.base = base; - _reloc.num_entries = resource_size(&imem) / PIL_RELOC_ENTRY_SIZE; + _reloc.num_entries = (u32)resource_size(&imem) / PIL_RELOC_ENTRY_SIZE; return 0; }