From patchwork Wed Jul 2 08:47:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 32943 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4FC4720560 for ; Wed, 2 Jul 2014 08:47:59 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id lx4sf67068631iec.0 for ; Wed, 02 Jul 2014 01:47:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=vpo9cwEyW5PjszueNJSxTUSWxc45jE/aaGXyp6pP5Nc=; b=DYEEA4/QiH4NxtI6P+IAYrUfAkwnuNjHQm+uZH92wTR4weSQZ/itD+CUZ4pk4IieoH YrJLcs1Kd6p9Hw9468+tZLOK2uei3AKtmoxULj2goV892brePHyQjNLUFdRrpk7widy0 M84aN3rLeHRiiy1xwjE3KvyeqveOVMTQWFpjPcge1OvF3H/B8ySv9slPxmWRmEjBlCKa ZS4zylP4lPsTiVOJDemc+AOepO/ja+tnaQCUe8rNOMvEYzs/Jt5QV9AJ6jkpNzmwk6he IXo0VYtEYKs008mxsBPWOMNAFZwBaL879ZNlfBad8xMU3fUDbUtj7ZIBf34XAtNpb/kG Ygyg== X-Gm-Message-State: ALoCoQnbWRCUn/MsBSEFJNw6Tec4ROmMISi3FaxO0mDQGOtC+34NdT+H3iBWknqgl4H0Txwi6U/M X-Received: by 10.182.29.1 with SMTP id f1mr27829747obh.23.1404290878851; Wed, 02 Jul 2014 01:47:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.53 with SMTP id q50ls845055qgd.2.gmail; Wed, 02 Jul 2014 01:47:58 -0700 (PDT) X-Received: by 10.52.231.8 with SMTP id tc8mr5120180vdc.35.1404290878756; Wed, 02 Jul 2014 01:47:58 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id fj8si12599121vdc.35.2014.07.02.01.47.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 01:47:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id i13so10737411veh.22 for ; Wed, 02 Jul 2014 01:47:58 -0700 (PDT) X-Received: by 10.58.235.130 with SMTP id um2mr7654815vec.18.1404290878645; Wed, 02 Jul 2014 01:47:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp277205vcb; Wed, 2 Jul 2014 01:47:58 -0700 (PDT) X-Received: by 10.68.252.73 with SMTP id zq9mr14887393pbc.146.1404290878005; Wed, 02 Jul 2014 01:47:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cl5si29620598pad.108.2014.07.02.01.47.57; Wed, 02 Jul 2014 01:47:57 -0700 (PDT) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751499AbaGBIry (ORCPT + 6 others); Wed, 2 Jul 2014 04:47:54 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:54378 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751563AbaGBIrx (ORCPT ); Wed, 2 Jul 2014 04:47:53 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s628lT4d031767; Wed, 2 Jul 2014 03:47:29 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s628lSbv013252; Wed, 2 Jul 2014 03:47:28 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Wed, 2 Jul 2014 03:47:28 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s628lOXX007645; Wed, 2 Jul 2014 03:47:27 -0500 From: Tero Kristo To: , , , CC: Subject: [PATCH 01/13] ARM: OMAP2+: clock/dpll: fix _dpll_test_fint arithmetics overflow Date: Wed, 2 Jul 2014 11:47:35 +0300 Message-ID: <1404290867-6768-2-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1404290867-6768-1-git-send-email-t-kristo@ti.com> References: <1404290867-6768-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: t-kristo@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The divider value provided to the _dpll_test_fint can reach value of 256 with J type DPLLs (USB etc.), which causes an overflow with the u8 datatype. Fix this by changing the parameter to be an int instead. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/clkt_dpll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c index 332af92..5aa734a 100644 --- a/arch/arm/mach-omap2/clkt_dpll.c +++ b/arch/arm/mach-omap2/clkt_dpll.c @@ -76,7 +76,7 @@ * (assuming that it is counting N upwards), or -2 if the enclosing loop * should skip to the next iteration (again assuming N is increasing). */ -static int _dpll_test_fint(struct clk_hw_omap *clk, u8 n) +static int _dpll_test_fint(struct clk_hw_omap *clk, int n) { struct dpll_data *dd; long fint, fint_min, fint_max;