Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp908269ybm; Wed, 27 May 2020 10:52:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvewfjZqLehNb4NxeDW0uj8Y9l3cTWxHuYiZPeNsLytNmrPET7mrGmyTknlLgvfSSfJQBJ X-Received: by 2002:a17:906:63c9:: with SMTP id u9mr7508153ejk.487.1590601961523; Wed, 27 May 2020 10:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590601961; cv=none; d=google.com; s=arc-20160816; b=kFgmjZ1mhoQzThq3TsQcmVq06hqErarpdISE5d/JbxNrK2dFeUMXkqXWyuMxNwRMAd 9HkIwooHdxMsb4uLjfLzpa4gbbrXaA6Sq8Q3U6/b1UslhfN9fD2zUermDm5BAXj+hP8H ht/8CNrsdr/Hrzn6QvTx2kR/Ku2lSX/Syh6a+Mu4i9XNH50HnYXeISU9C2vhoi5g41y3 WfKSyJQ2gcP4fCKr+MPInb449Sw0wXZ9/6EyKRfDaYBfKt33ZqaAcqflo6Lo1N1PgBZq dSgD8IjQeHql8wAIZ37gOxWUYk0Ue0hGW1EPGl9jol+xJrTJn9kwMOkif6IlRlfLh+pG Xcag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=rNWdUdNwWByxlKEc8u8jqMdUhWtSKuuHhUcgU+SnBfk=; b=bAh33g1EnjwO3RfNdd4HiufGguRTN8ttkZsoUlDQ8cMLE+9XlqNNHmDCzXuGMUvtPj w1JPExOKjxhiatJx7of4viXMH/bL9Empk6gI2NdRkYHH4TGtgY4CAINeUG2dbaWBaI7p 6wWFjvzFoSK5agEWjuW4VfI9gcH72gLU7XDdmLTMN/5MO3byn0XOY8UrTX0Oyckq6fU3 xNMTWAVBrPAc+q50lvsIpeCMwHdrvDm0x7PJzfzctEjOHLQ7X/pjI0UrHEilWffomrbp GaPW0fwgVhC2OlfrWJ97Ysil7UxbLv8sz1+edEqEB5USMNATtkzrQDgYah7OuNy0u7bR Vq/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt28si2495794ejb.256.2020.05.27.10.52.18; Wed, 27 May 2020 10:52:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388393AbgE0Nfu (ORCPT + 99 others); Wed, 27 May 2020 09:35:50 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:44793 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387664AbgE0Nft (ORCPT ); Wed, 27 May 2020 09:35:49 -0400 Received: from localhost.localdomain ([149.172.98.151]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MTfgb-1jS00D30If-00TzYS; Wed, 27 May 2020 15:35:44 +0200 From: Arnd Bergmann To: Georgi Djakov , Rob Clark , Kalyan Thota Cc: Arnd Bergmann , Matthias Kaehlcke , Sibi Sankar , Viresh Kumar , Evan Green , Akash Asthana , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/msm/dpu: avoid open-coded 64-bit division Date: Wed, 27 May 2020 15:35:38 +0200 Message-Id: <20200527133543.599948-1-arnd@arndb.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:mqnHLGtnwdS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dI4gigMsR5vpztP Olr/1Sq+iqBX57qtbUOyfuD8SwG6bd2oRTKUGV3MNzlSqkXXJU= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 64-bit integer division is normally not allowed in the kernel because of the large overhead on 32-bit machines: drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.o: in function `_dpu_core_perf_crtc_update_bus': dpu_core_perf.c:(.text+0x810): undefined reference to `__aeabi_uldivmod' The function already contains a call to do_div(), so I assume this is never called in a performance critical context, and we can use div_u64 for the second one as well. Fixes: 04d9044f6c57 ("drm/msm/dpu: add support for clk and bw scaling for display") Signed-off-by: Arnd Bergmann --- include/linux/interconnect.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/interconnect.h b/include/linux/interconnect.h index 3a63d98613fc..8279fe9b2082 100644 --- a/include/linux/interconnect.h +++ b/include/linux/interconnect.h @@ -11,7 +11,7 @@ #include /* macros for converting to icc units */ -#define Bps_to_icc(x) ((x) / 1000) +#define Bps_to_icc(x) div_u64((x), 1000) #define kBps_to_icc(x) (x) #define MBps_to_icc(x) ((x) * 1000) #define GBps_to_icc(x) ((x) * 1000 * 1000) -- 2.26.2