From patchwork Thu Apr 17 09:53:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 339826 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id D945714016D for ; Thu, 17 Apr 2014 20:05:21 +1000 (EST) X-Greylist: delayed 629 seconds by postgrey-1.34 at bilbo; Thu, 17 Apr 2014 20:04:07 EST Received: from winston.telenet-ops.be (winston.telenet-ops.be [195.130.137.75]) by ozlabs.org (Postfix) with ESMTP id 2AEB9140089 for ; Thu, 17 Apr 2014 20:04:07 +1000 (EST) Received: from andre.telenet-ops.be (andre.telenet-ops.be [195.130.132.53]) by winston.telenet-ops.be (Postfix) with ESMTP id D247C1BDD4E for ; Thu, 17 Apr 2014 11:53:33 +0200 (CEST) Received: from ayla.of.borg ([84.193.72.141]) by andre.telenet-ops.be with bizsmtp id qxtZ1n00P32ts5g01xtZcA; Thu, 17 Apr 2014 11:53:33 +0200 Received: from geert by ayla.of.borg with local (Exim 4.76) (envelope-from ) id 1Waj0f-0003cw-1S; Thu, 17 Apr 2014 11:53:33 +0200 From: Geert Uytterhoeven To: "Rafael J. Wysocki" , Viresh Kumar Subject: [PATCH 2/3] cpufreq: ppc: Fix integer overflow in expression Date: Thu, 17 Apr 2014 11:53:26 +0200 Message-Id: <1397728407-13909-2-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397728407-13909-1-git-send-email-geert+renesas@glider.be> References: <1397728407-13909-1-git-send-email-geert+renesas@glider.be> Cc: Geert Uytterhoeven , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 32-bit, "12 * NSEC_PER_SEC" doesn't fit in "unsigned long" (NSEC_PER_SEC is a "long" constant), causing an integer overflow: drivers/cpufreq/ppc-corenet-cpufreq.c: In function 'corenet_cpufreq_cpu_init': drivers/cpufreq/ppc-corenet-cpufreq.c:211:9: warning: integer overflow in expression [-Woverflow] Force the intermediate to be 64-bit by adding an "ULL" suffix to the constant multiplier to fix this. Signed-off-by: Geert Uytterhoeven Acked-by: Viresh Kumar --- drivers/cpufreq/ppc-corenet-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/ppc-corenet-cpufreq.c index e78f9c806de4..53881d78a931 100644 --- a/drivers/cpufreq/ppc-corenet-cpufreq.c +++ b/drivers/cpufreq/ppc-corenet-cpufreq.c @@ -208,7 +208,7 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy) per_cpu(cpu_data, i) = data; policy->cpuinfo.transition_latency = - (12 * NSEC_PER_SEC) / fsl_get_sys_freq(); + (12ULL * NSEC_PER_SEC) / fsl_get_sys_freq(); of_node_put(np); return 0;