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: 356148 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp14268734jai; Sun, 3 Jan 2021 05:57:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkrIsOcaOdatGPEqY4ekSlWWOpPw/dfzfGPHYmeQqF/6/RcZmCSytHj0XTzHfoJVFBX7ZM X-Received: by 2002:a05:6402:b57:: with SMTP id bx23mr65868089edb.191.1609682248009; Sun, 03 Jan 2021 05:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609682248; cv=none; d=google.com; s=arc-20160816; b=cEg6oEqFG87Gv2wIMqZr3udZ1/wBEpaDOIR+fjG2BYEste4T3uN2UER+Py2VJje4cJ GrcnSUYlEY5l4pUHAu6Tuc85zZiuaOEF+pZlcWMaB3lsetzFySyp6yZD0vI6G+8qmfVC 84ddu/MTvlthWd4gqlF5yZg7j/o5RSaFxawqw4UmVxKhRZspJTwtBUOFfs9PRN3Y4CzD SKhzz/+n8UGYKMztmbHfNwFI+fkHZucs/LH9+X0CuQDD6tc5YuBBO2HQ2KRXiJHu1Rx7 l8Mx/9E5+BmazynC8be8a+/JdBt2BiPi83iGBuWVoXeVTKVLeifpajx97fMUJdU0MDWG O4Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=K0ETVvsNazLq9wCTSplPFroE4w2GuKY/7i+JIW0zuzk=; b=QQTy316y93nmsC5wh+XrxMnXW3unWTERom3/MPRMG0P/oy2pwDUiaqWOVsJP1JgrLJ wJnHkU0cHplh5jT7scKVD7rycYXYQzZSe4+iyNtQUIDY1g/+y3FYrNhnV9HsBrC56cUy TVUnt+3UgxkfufdH7+qNtWSq6haA/0aix1hdhAgCgk8tf7j2Gu11h84RQvn/YGSeEwH2 M3fNThyiCAKziMh+YrQa59BcpbxRDU6DKjk9gJemcWGPhVpgSyW4yDyObUIciGk+l/jc 6ceRT2HmyBfoi2P0SKLCKOOV0iqV1VTfC24Iqk9KWib/t22Tdtve+HDBTPcwUmN2mOet 8sDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ps595AIp; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si26152329ejx.420.2021.01.03.05.57.27; Sun, 03 Jan 2021 05:57:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ps595AIp; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726688AbhACN5N (ORCPT + 15 others); 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(-) -- 2.29.2 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; }