From patchwork Tue Nov 3 22:13:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 55956 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp2081094lbr; Tue, 3 Nov 2015 14:14:06 -0800 (PST) X-Received: by 10.66.164.201 with SMTP id ys9mr36945686pab.50.1446588846446; Tue, 03 Nov 2015 14:14:06 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si3166671pas.51.2015.11.03.14.14.06; Tue, 03 Nov 2015 14:14:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756020AbbKCWOB (ORCPT + 11 others); Tue, 3 Nov 2015 17:14:01 -0500 Received: from mail-qg0-f47.google.com ([209.85.192.47]:33523 "EHLO mail-qg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755837AbbKCWOA (ORCPT ); Tue, 3 Nov 2015 17:14:00 -0500 Received: by qgeo38 with SMTP id o38so26408612qge.0 for ; Tue, 03 Nov 2015 14:13:59 -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=ppXxxAFyrfCH20+X6MRE5kVnc45j3z+5kJptXjsYEuE=; b=djBoTtCOIrP2GodradYSZzIAJd8dhnAmnRhEzmYoZTE0dM55ioG4ZSWeIKf72kRw2j fkygarCGqusrSjbcbpXo+AAYFCU1SMJRCkzHgmcUJLZl96Rdtw7b+jN0eOJcI5kU7ZE5 yFbvB9exYfxHSuEKJY40VXiknKa59dxY2eTos60NdWvUjFWBQztCU8HOmt+u/HLWuWof 9GoOVk2y9XXJmkFqFsljHaZFWGlhE+zjn+Y3zJiW7obCimwn8WI16aJYSIGez0PM4hLW f1WAEvNIvu++APYMvcS/1WoFjVYspHjIy71vOtIcjSI2PUCq/SbPMsn5PndzdL7xEvn1 H7aA== 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=ppXxxAFyrfCH20+X6MRE5kVnc45j3z+5kJptXjsYEuE=; b=j8Vvk4rZTjM8pIiVIJvUV1kO1U9kpACwtB3J7Y7ZEXTrxW3LRGV7wztTfgOGhxI68R J4klL/EzUzDaxyHpJSKim7ePb7LEJVDa0/rGAJzdplho8CvSlm6M2I298FOblViGwgOF g0cPrGCj8eRdyCQcMyhBHkR0guzLP8if2sz4yqH9nTIC4P5AJU/CIpKwO8be+leKk9aN nirRRfjGKZ8QH6o+2Mi+7Um4Wls/SxRG/yTY0ps6FNmbczpjvcdPF74niLX+89HFoM7i VdhOorK0RZGehaUG/XbpqZBrC9Y3suY9dE23IQpDkDTzBbhOHkXj3Zkvoa9Qol+qIbf2 bGIw== X-Gm-Message-State: ALoCoQlnczwfFC3a3PY6/hDYlAMBcpjBNcFUHdQb0tmp5uoepn/CYxLfk6fAs+ysMC03RDhpninx X-Received: by 10.141.4.135 with SMTP id g129mr42713268qhd.45.1446588839213; Tue, 03 Nov 2015 14:13:59 -0800 (PST) Received: from xanadu.home (modemcable065.157-23-96.mc.videotron.ca. [96.23.157.65]) by smtp.gmail.com with ESMTPSA id g140sm10426421qhc.22.2015.11.03.14.13.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2015 14:13:58 -0800 (PST) Date: Tue, 3 Nov 2015 17:13:57 -0500 (EST) From: Nicolas Pitre To: "Rafael J. Wysocki" , Viresh Kumar cc: linux-pm@vger.kernel.org Subject: [PATCH] s5pv210-cpufreq: fix wrong do_div() usage Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org It is wrong to use do_div() with 32-bit dividends (unsigned long is 32 bits on 32-bit architectures). Signed-off-by: Nicolas Pitre -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Viresh Kumar diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c index 9e231f5215..051a8a8224 100644 --- a/drivers/cpufreq/s5pv210-cpufreq.c +++ b/drivers/cpufreq/s5pv210-cpufreq.c @@ -212,11 +212,11 @@ static void s5pv210_set_refresh(enum s5pv210_dmc_port ch, unsigned long freq) /* Find current DRAM frequency */ tmp = s5pv210_dram_conf[ch].freq; - do_div(tmp, freq); + tmp /= freq; tmp1 = s5pv210_dram_conf[ch].refresh; - do_div(tmp1, tmp); + tmp1 /= tmp; __raw_writel(tmp1, reg); }