Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755027AbbBFJZH (ORCPT ); Fri, 6 Feb 2015 04:25:07 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:7442 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751925AbbBFJZF (ORCPT ); Fri, 6 Feb 2015 04:25:05 -0500 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Fri, 06 Feb 2015 01:24:23 -0800 Message-ID: <54D48851.9030207@nvidia.com> Date: Fri, 6 Feb 2015 18:24:33 +0900 From: Alexandre Courbot Organization: NVIDIA User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Geert Uytterhoeven , David Airlie , Ben Skeggs CC: , , Subject: Re: [PATCH v2] drm/nouveau/clk: Change rate from u32 to u64 in gk20a_pllg_calc_rate() References: <1423214458-23033-1-git-send-email-geert@linux-m68k.org> In-Reply-To: <1423214458-23033-1-git-send-email-geert@linux-m68k.org> X-NVConfidentiality: public X-Originating-IP: [10.19.57.128] X-ClientProxiedBy: DRBGMAIL104.nvidia.com (10.18.16.23) To HKMAIL103.nvidia.com (10.18.16.12) Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3610 Lines: 75 On 02/06/2015 06:20 PM, Geert Uytterhoeven wrote: > 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, causing the warning. > > As the product of priv->parent_rate and priv->n may no longer fit in u32 > soon, change rate from u32 to u64, which also fixes the warning. > > Signed-off-by: Geert Uytterhoeven > --- > Compile-tested only. > > This is v2 of "drm/nouveau/clk: Use plain "/" for 32-bit division". > > v2: > - Change rate from u32 to u64 instead of changing the division. > > parisc/allmodconfig: > http://kisskb.ellerman.id.au/kisskb/buildresult/12358386/ > --- > drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c > index 65c532742b08d1c6..e87a964b8bea4d30 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c > @@ -139,7 +139,7 @@ gk20a_pllg_read_mnp(struct gk20a_clk_priv *priv) > static u32 > gk20a_pllg_calc_rate(struct gk20a_clk_priv *priv) > { > - u32 rate; > + u64 rate; > u32 divider; > > rate = priv->parent_rate * priv->n; > Tested-by: Alexandre Courbot Adding Ben as he might want to take this in his tree? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/