From patchwork Wed Feb 4 16:02:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 5777991 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8039BBF440 for ; Wed, 4 Feb 2015 16:07:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A70C820155 for ; Wed, 4 Feb 2015 16:07:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C149C2014A for ; Wed, 4 Feb 2015 16:07:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C39FE6E117; Wed, 4 Feb 2015 08:07:39 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 300 seconds by postgrey-1.34 at gabe; Wed, 04 Feb 2015 08:07:37 PST Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [195.130.132.52]) by gabe.freedesktop.org (Postfix) with ESMTP id E17A56E117 for ; Wed, 4 Feb 2015 08:07:37 -0800 (PST) Received: from ayla.of.borg ([84.193.93.87]) by xavier.telenet-ops.be with bizsmtp id oG2a1p00w1t5w8s01G2aBv; Wed, 04 Feb 2015 17:02:35 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1YJ2PS-0007lf-8h; Wed, 04 Feb 2015 17:02:34 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1YJ2PU-00052U-Dz; Wed, 04 Feb 2015 17:02:36 +0100 From: Geert Uytterhoeven To: David Airlie , Alexandre Courbot Subject: [PATCH -next] drm/nouveau/clk: Use plain "/" for 32-bit division Date: Wed, 4 Feb 2015 17:02:35 +0100 Message-Id: <1423065755-19337-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.9.1 Cc: linux-next@vger.kernel.org, Geert Uytterhoeven , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 32-bit platforms using asm-generic/div64.h: drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c: In function 'gk20a_pllg_calc_rate': drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c:147:79: warning: comparison of distinct pointer types lacks a cast do_div(rate, divider); ^ drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c:147:2: warning: right shift count >= width of type do_div(rate, divider); ^ drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c:147:238: warning: passing argument 1 of '__div64_32' from incompatible pointer type do_div(rate, divider); ^ In file included from arch/parisc/include/generated/asm/div64.h:1:0, from include/linux/kernel.h:124, from include/linux/list.h:8, from include/linux/preempt.h:10, from include/linux/spinlock.h:50, from include/linux/mmzone.h:7, from include/linux/gfp.h:5, from include/linux/slab.h:14, from drivers/gpu/drm/nouveau/include/nvif/os.h:5, from drivers/gpu/drm/nouveau/include/nvkm/core/os.h:3, from drivers/gpu/drm/nouveau/include/nvkm/core/object.h:3, from drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h:3, from drivers/gpu/drm/nouveau/include/nvkm/subdev/clk.h:3, from drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c:25: include/asm-generic/div64.h:35:17: note: expected 'uint64_t *' but argument is of type 'u32 *' extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor); ^ do_div() is meant for 64-bit by 32-bit division, but both the dividend and divisor are 32-bit here. Hence use plain "/" instead. Signed-off-by: Geert Uytterhoeven --- Compile-tested only. parisc/allmodconfig: http://kisskb.ellerman.id.au/kisskb/buildresult/12358386/ --- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c index 65c532742b08d1c6..022595876ea4dc85 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c @@ -144,9 +144,8 @@ gk20a_pllg_calc_rate(struct gk20a_clk_priv *priv) rate = priv->parent_rate * priv->n; divider = priv->m * pl_to_div[priv->pl]; - do_div(rate, divider); - return rate / 2; + return rate / divider / 2; } static int