From patchwork Tue Jul 15 17:00:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sam-the-6 X-Patchwork-Id: 33680 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f70.google.com (mail-qg0-f70.google.com [209.85.192.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1EB63201F1 for ; Tue, 15 Jul 2014 17:15:29 +0000 (UTC) Received: by mail-qg0-f70.google.com with SMTP id z60sf8866041qgd.5 for ; Tue, 15 Jul 2014 10:15:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=0l2Rw+0Xvf9wUGjM6MR4tC1yikVKHgtmuGZAu8l3hcA=; b=DYyiqfAQ5myRh5uKaGCZ4p3+P6vPWzAvghyn/bgP9uvFrnDrwvP9RQpvxjnMnC1Fz6 1l9GsbCYqc5Y9DE3lDpefIMJX0DMk4C07DFHBr5VGA9x1uszL+kJd8EFdi0l9bph84kt HHjuULEjh2ZH2ZGKuZYIVXLGikdXqcR4FIOmrF3OcSCSo4TiadvLOKsd9MmiXXe49FVz OWEaHu8fszjZK+oWUXrNUqKk97zB3H0xKqjieiSMgqnTfv3HJfYN0wVYWiwKRFj9/xhJ 6mIWv9dHMsoyCflL8KJNGS3O77OrqbBLsQcqzAXBZ8e+BfGL4MD9Ek91D+DOsaZBWjBV OY9g== X-Gm-Message-State: ALoCoQm0666UKHOgiShioENgzxbyfFd2Ozj//Nk7evfe/xg+/Sh2dJ2QYV7UNW69+cE+WvVixVdH X-Received: by 10.52.114.42 with SMTP id jd10mr10027648vdb.0.1405444529669; Tue, 15 Jul 2014 10:15:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.46.99 with SMTP id j90ls168104qga.49.gmail; Tue, 15 Jul 2014 10:15:29 -0700 (PDT) X-Received: by 10.220.17.199 with SMTP id t7mr23699186vca.1.1405444529347; Tue, 15 Jul 2014 10:15:29 -0700 (PDT) Received: from mail-vc0-x22e.google.com (mail-vc0-x22e.google.com [2607:f8b0:400c:c03::22e]) by mx.google.com with ESMTPS id a10si7076700vda.2.2014.07.15.10.15.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jul 2014 10:15:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22e as permitted sender) client-ip=2607:f8b0:400c:c03::22e; Received: by mail-vc0-f174.google.com with SMTP id la4so5795871vcb.33 for ; Tue, 15 Jul 2014 10:15:29 -0700 (PDT) X-Received: by 10.53.5.230 with SMTP id cp6mr18575375vdd.25.1405444529256; Tue, 15 Jul 2014 10:15:29 -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 tc5csp231382vcb; Tue, 15 Jul 2014 10:15:28 -0700 (PDT) X-Received: by 10.66.246.138 with SMTP id xw10mr3168799pac.142.1405444528119; Tue, 15 Jul 2014 10:15:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ty10si7267742pac.81.2014.07.15.10.15.27; Tue, 15 Jul 2014 10:15:27 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S1758189AbaGOROo (ORCPT + 28 others); Tue, 15 Jul 2014 13:14:44 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:41884 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754919AbaGORCM (ORCPT ); Tue, 15 Jul 2014 13:02:12 -0400 Received: by mail-wi0-f177.google.com with SMTP id ho1so4691924wib.16 for ; Tue, 15 Jul 2014 10:02:11 -0700 (PDT) X-Received: by 10.194.186.178 with SMTP id fl18mr28298985wjc.83.1405443731891; Tue, 15 Jul 2014 10:02:11 -0700 (PDT) Received: from Debian ([94.54.73.8]) by mx.google.com with ESMTPSA id h3sm33778481wjz.48.2014.07.15.10.02.08 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 15 Jul 2014 10:02:10 -0700 (PDT) Received: from sam by Debian with local (Exim 4.80) (envelope-from ) id 1X767C-000425-Fh; Tue, 15 Jul 2014 20:02:06 +0300 From: Sam Asadi To: gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Tero Kristo , Paul Walmsley , sam-the-6 Subject: [PATCH 38/94] ARM: OMAP2+: clock/dpll: fix _dpll_test_fint arithmetics overflow Date: Tue, 15 Jul 2014 20:00:53 +0300 Message-Id: <1405443709-15288-38-git-send-email-asadi.samuel@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1405443709-15288-1-git-send-email-asadi.samuel@gmail.com> References: <1405443709-15288-1-git-send-email-asadi.samuel@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: asadi.samuel@gmail.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22e as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com 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: , From: Tero Kristo 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 [paul@pwsan.com: changed type of 'n' to unsigned int] Signed-off-by: Paul Walmsley Signed-off-by: sam-the-6 --- 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..67fd26a 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, unsigned int n) { struct dpll_data *dd; long fint, fint_min, fint_max;