From patchwork Mon Mar 8 15:32:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 395441 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1808119jai; Mon, 8 Mar 2021 07:33:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQv0h/SuG7Xep03rmDACf5pLrG5+C9BdIVMsasA45cqmHi2dlTkdD5Xpt6sNo9VRJXv6H/ X-Received: by 2002:a17:906:2804:: with SMTP id r4mr15425044ejc.521.1615217581281; Mon, 08 Mar 2021 07:33:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615217581; cv=none; d=google.com; s=arc-20160816; b=jh3+yBsklxxatHdqy2ZHr5aiSuehagbxNVkvEflkmDZGg26tIbNxsH1eRt5kM5e+jS IIsKHndLbeP+bgLSGSgZrNyrh8iuWmEKwbvirvvSwKIOQMqMXio5gsalmcwU49MRJ41/ oFRQDj4uq1sUzpbUegBOADZhmVJvqxmbPrBqVPvsmffHfVLAzXXwUlJF7rr9NJ9SzjvF E6nITVPSIvwdw1mta0g0zKuC6Vht363p8NKvAE4BtJYFyFgVFXLD6Rr5cAxSr+w0MLq8 oaBZzKKdtsUJwlB5OpEqFfKsbnDVUmXtj3VVi5vewthxsfz8ncA9aFk7XY0xw7geQg6z oftw== 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=ERSxVDLlpjS+mv9qYT9kfrvINMCjxDQuvzIZoXzm894=; b=VziJ5g0OXhDFcjHrBwGv405QcEXsNtmugecvYH/m7MWoj/3IA+j++ntXn7KF1CBCrR rp57wugNcAWk560+F6hQIxWSRKlgrr8F7mQ40TEahvBNASVZ5DfoBMv/drqc3TFsKMvM +lKKaa59rQy7O52lC+8NYqQEhr6mQVDd247b8AfOsWf7Q94w7xH/CxFvc9rhrXoJ5+B5 f3UxuEUf8IrooVA+Wc1kSrPGDPrXBvVpkgv5Gajp/T5dFW+xH9KS7ZIM5SXzZjZVtsMC tGwYa0Jq1n2PP/j1so8bleSpZQAzLuRcqe1bpSBmsi1MrMEsNSUqKmg7PZsD/HSNGfiu U9hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kKkxb4vr; 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 de4si6680610ejc.539.2021.03.08.07.33.00; Mon, 08 Mar 2021 07:33:01 -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=kKkxb4vr; 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 S230200AbhCHPc3 (ORCPT + 16 others); Mon, 8 Mar 2021 10:32:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:60478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbhCHPcU (ORCPT ); Mon, 8 Mar 2021 10:32:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 041506526A; Mon, 8 Mar 2021 15:32:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615217539; bh=Q86KQofgOs8LGcTYRssgtJBsRLc5fpn3UtwJj0yn+KM=; h=From:To:Cc:Subject:Date:From; b=kKkxb4vr1CCV3Axd66l/YyiwSjXCNP4S3M6FciIGgAl5BxfVV33+fRcJp0+4t2Upw frdAWTqojIujgU5KhUukBZLrwnuYs6dM85oY/gTFi9SDI+qxmoeKi4uCatcYD5myTZ wazFhaHDh40+SU2lpBzwZzO4Y7LucTG43ZvtjLv/8rFRGosBPm/c8cNZ6vXXrP/Xqn rs6YXIGZxObXZFPrn84gx8w73zXZtsxmS/OAfuxMaYGPuL3pR6fYKEBpLNZBAeQLet YBKiAKp1gQJmC+FrD+/omX2oDqkzXMAmskzKGCmnPsan4hg49oL8LI3txtYGpEIOhq tyWuYC0hcF4ug== From: Arnd Bergmann To: Andy Gross , Bjorn Andersson , Ohad Ben-Cohen Cc: Arnd Bergmann , Vinod Koul , Mathieu Poirier , 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 on 32-bit architectures Date: Mon, 8 Mar 2021 16:32:02 +0100 Message-Id: <20210308153215.2449563-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 In some randconfig builds, a 64-bit resource_size_t is used even on 32-bit architectures, which now leads to a link-time error: ERROR: modpost: "__aeabi_uldivmod" [drivers/remoteproc/qcom_pil_info.ko] undefined! Using the div_u64() helper here. A cast to 32 bits length would also work, but for a constant divider there should not be much difference. Fixes: 549b67da660d ("remoteproc: qcom: Introduce helper to store pil info in IMEM") Signed-off-by: Arnd Bergmann --- drivers/remoteproc/qcom_pil_info.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.29.2 diff --git a/drivers/remoteproc/qcom_pil_info.c b/drivers/remoteproc/qcom_pil_info.c index 5521c4437ffa..95b6b7609a87 100644 --- a/drivers/remoteproc/qcom_pil_info.c +++ b/drivers/remoteproc/qcom_pil_info.c @@ -56,7 +56,8 @@ 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 = div_u64(resource_size(&imem), + PIL_RELOC_ENTRY_SIZE); return 0; }