From patchwork Tue Nov 3 22:01:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 55955 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp2075879lbr; Tue, 3 Nov 2015 14:01:51 -0800 (PST) X-Received: by 10.68.239.105 with SMTP id vr9mr36366421pbc.161.1446588111505; Tue, 03 Nov 2015 14:01:51 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id n10si2615461pap.139.2015.11.03.14.01.51; Tue, 03 Nov 2015 14:01:51 -0800 (PST) Received-SPF: pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5EF9B6E830; Tue, 3 Nov 2015 14:01:50 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-f51.google.com (mail-qg0-f51.google.com [209.85.192.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3DDCC6E830 for ; Tue, 3 Nov 2015 14:01:49 -0800 (PST) Received: by qgad10 with SMTP id d10so25787716qga.3 for ; Tue, 03 Nov 2015 14:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:user-agent:mime-version :content-type; bh=6bOJYx3t9K7Yk+5W0RKn/RNutWu7KNZxWDBmLn+C/tg=; b=pV2GqwHTcCajWdGT8fW3H8CQK+o698rQ5k7EsFYe1lZDuE00KGWHtPflr3293q9Xyd 1bsoYjzfSXZun3P0WROioba1TIGeIw1rj04UOlDCchNRUORAMjHyWRcNhM6pJD1RCB1r +IjhxFdtxWXQM1LQxTSw+m74TVg01ScyvMnjHhQEAE9OxJhABWX8uQXZZFboxVUA5Ceu rP+tKq6hnigcJaQFAPUI3lvULrGadAyWSvrasY+gbqzDL0kQX+CKMuLEhd5sVAs6dVXC T5Pk26unajiWDkASQ2zFm+IbgsczI8gnMaKb0AjIzyV3C75GJVvSQ0fazrdawcCLp6KU VjZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version:content-type; bh=6bOJYx3t9K7Yk+5W0RKn/RNutWu7KNZxWDBmLn+C/tg=; b=aGoadaIaC5D6+ymkzygd0fmWnMmoOJwc5eDK8F+RJPhMUzPeI5tA9jgXF5rYFis50J xm7WI6tSxuUtNkt2DwiKUulubAa5Ur5OG+JeegRt/SDfvxBbx6MtVmx2XTcaTac8oplb FRsw2tnOOky2B8KtTMYf7NutGAsQnZevauvxQmE6OBhvWpXscs5pc1A8J6IuorI7Wlky x/OPtfr+fT3MsVuE00whJfOq3ZVbF3hJ8CGZe7bo64p1dLGw3MMw3eJbmBHPFpkpz0L5 goqE0QyT5YSM3wB+VTRfQvduZ6Yf1LmXrfO/bTzNG4KTrrjhoICimnKkocIoIml8CwZ1 Z7vA== X-Gm-Message-State: ALoCoQlfRC/6V8Eg3xRChjxfARqXV1C9vnNeFNJBJFyrlqWecKzu+bmoggRuLrsLl23h4muEGzOW X-Received: by 10.141.1.6 with SMTP id c6mr15888844qhd.9.1446588108258; Tue, 03 Nov 2015 14:01:48 -0800 (PST) Received: from xanadu.home (modemcable065.157-23-96.mc.videotron.ca. [96.23.157.65]) by smtp.gmail.com with ESMTPSA id u17sm10481625qge.8.2015.11.03.14.01.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2015 14:01:47 -0800 (PST) Date: Tue, 3 Nov 2015 17:01:46 -0500 (EST) From: Nicolas Pitre To: David Airlie Subject: [PATCH] nouveau/nvkm/subdev/clk/gk20a.c: fix wrong do_div() usage Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Cc: Ben Skeggs , 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" do_div() must only be used with a u64 dividend. Signed-off-by: Nicolas Pitre diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c index 254094ab7f..5da2aa8cc3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c @@ -141,9 +141,8 @@ gk20a_pllg_calc_rate(struct gk20a_clk *clk) rate = clk->parent_rate * clk->n; divider = clk->m * pl_to_div[clk->pl]; - do_div(rate, divider); - return rate / 2; + return rate / divider / 2; } static int