From patchwork Wed Dec 5 13:31:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amar X-Patchwork-Id: 13376 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 609F74C15B0 for ; Wed, 5 Dec 2012 13:12:06 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id D3B00A18ECF for ; Wed, 5 Dec 2012 13:12:05 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so7815662ieb.11 for ; Wed, 05 Dec 2012 05:12:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :dlp-filter:x-mtr:x-brightmail-tracker:x-brightmail-tracker :x-cfilter-loop:x-gm-message-state; bh=y85MItJH3B0+UnGY7PMFtGjlPaQuaYB79HELKb57I1A=; b=P1KWn4ln5r2aSserbvRz9TwuA5/YUi+ng4aROcgdB+aWdBCE/Vi/Hi38ovjq+S5VK6 4xF05XD1u4TwNRGcB6eVBLDgcZv0HSAXLrsP0Vq4HogsoEKw2xO3v4R0niYBFGkMZGc0 4xGccw/agZyDqujBCunCV8v0VodeV7JDbV6C3NBPayXHEwTA+c0OawV4H5lsUH+Dg6cu jyAaKBpThvEt9VBFRtoFFC14WHF3kKBuAk3xXt5t10YVky/Q/EGOfmSiT8rypgj3czRp nm2Bg5NjP16OHztPV5CU2UlPOSvbPJ2TdJYln2k7C5781ioBef726qM3tErZZ7Fnr3fl EhDQ== Received: by 10.50.42.168 with SMTP id p8mr1690974igl.57.1354713125203; Wed, 05 Dec 2012 05:12:05 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp338308igt; Wed, 5 Dec 2012 05:12:04 -0800 (PST) Received: by 10.66.83.6 with SMTP id m6mr10482719pay.52.1354713124514; Wed, 05 Dec 2012 05:12:04 -0800 (PST) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id e6si6479280paw.259.2012.12.05.05.12.03; Wed, 05 Dec 2012 05:12:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.34 as permitted sender) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.34 as permitted sender) smtp.mail=amarendra.xt@samsung.com Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MEK00NGF7C10911@mailout4.samsung.com>; Wed, 05 Dec 2012 22:12:02 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.126]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 72.60.12699.2284FB05; Wed, 05 Dec 2012 22:12:02 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-9a-50bf4822e01f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 22.60.12699.2284FB05; Wed, 05 Dec 2012 22:12:02 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MEK00BI176AKQA0@mmp1.samsung.com>; Wed, 05 Dec 2012 22:12:02 +0900 (KST) From: Amar To: u-boot@lists.denx.de, jh80.chung@samsung.com Cc: patches@linaro.org, sjg@chromium.org, mk7.kang@samsung.com, chander.kashyap@linaro.org, afleming@gmail.com Subject: [PATCH 3/4] EXYNOS: CLOCK: Initialised the local variable Date: Wed, 05 Dec 2012 19:01:36 +0530 Message-id: <1354714297-11568-4-git-send-email-amarendra.xt@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1354714297-11568-1-git-send-email-amarendra.xt@samsung.com> References: <1354714297-11568-1-git-send-email-amarendra.xt@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsWyRsSkTlfJY3+AwbTXRhYP199ksZhy+AuL A5PHnWt72AIYo7hsUlJzMstSi/TtErgyNi2axlhwkLNi2zWzBsY37F2MnBwSAiYS/3Y/YIKw xSQu3FvP1sXIxSEksJRRovnfP7iidx8/sUIkFjFK/PpwDcppZ5K4uf85kMPBwSagKvFrsT1I g4iAgcT0J9vBwswCBRLPdouBhIUFnCTOvbzFCmKzAFV/PPWSEcTmFfCQ2PVxG9QuBYnWZYfA bE4BT4nmuw/BbCGgmgNfLjJB9ApIfJt8iAVkvISArMSmA8wg10gIXGeT2DzhNdQzkhIHV9xg mcAovICRYRWjaGpBckFxUnqukV5xYm5xaV66XnJ+7iZGYCie/vdMegfjqgaLQ4wCHIxKPLwS xvsChFgTy4orcw8xSnAwK4nw3nTdHyDEm5JYWZValB9fVJqTWnyI0QfokonMUqLJ+cA4ySuJ NzQ2MTc1NrU0MjIzNcUhrCTO2+yREiAkkJ5YkpqdmlqQWgQzjomDU6qB0eWZ87c1Pg1mzedZ ha10c9X418r7iz+Vsg0KOO/bzKrA9cV/z8JlNsuU/mY5HI9+/0FH0GPrxq+KrRrrNR8U3nTc b6pewHw9JmnL8ciKM98vfvCzvpb8+sMqRa+DjRLd/WdqPe88VwyfcKnTLGjG03uRL0JnZL1j PWx19evu2Wv+vRV7sGZVvxJLcUaioRZzUXEiALUi9VpyAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42I5/e+xgK6Sx/4Ag6WT1Cwerr/JYjHl8BcW ByaPO9f2sAUwRjUw2mSkJqakFimk5iXnp2TmpdsqeQfHO8ebmhkY6hpaWpgrKeQl5qbaKrn4 BOi6ZeYAzVZSKEvMKQUKBSQWFyvp22GaEBripmsB0xih6xsSBNdjZIAGEtYwZmxaNI2x4CBn xbZrZg2Mb9i7GDk5JARMJN59/MQKYYtJXLi3nq2LkYtDSGARo8SvD9dYIZx2Jomb+58DORwc bAKqEr8W24M0iAgYSEx/sh0szCxQIPFstxhIWFjASeLcy1tgM1mAqj+eeskIYvMKeEjs+rgN aq+CROuyQ2A2p4CnRPPdh2C2EFDNgS8XmSYw8i5gZFjFKJpakFxQnJSea6RXnJhbXJqXrpec n7uJERzoz6R3MK5qsDjEKMDBqMTDK2G8L0CINbGsuDL3EKMEB7OSCO9N1/0BQrwpiZVVqUX5 8UWlOanFhxh9gK6ayCwlmpwPjMK8knhDYxNzU2NTSxMLEzNLHMJK4rzNHikBQgLpiSWp2amp BalFMOOYODilGhiLejtfH81ae/+m2LeF/1QND6nbGql5bi7oXLBwnmLxwldcCxyvZLy2UDVc kZAsXXriiL/GohWRarqNvnlNx5UEzHJ2d3W8z24Inyh7OM1+l9DXj19Cs+ZY8Oc/dr+Z3+yg 2bdzRaxZyGc9xeSapQa8qRJdH/5z+XzZyvNpTWL8nIv73Ca8CVJiKc5INNRiLipOBADUVyeV oQIAAA== X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQlR9U+WV3/RdEeVkkEdbbQbx8bK7TKSs3M2gUWyUtFfSmvjWzB/EcEmRmQ0e0DnA4NUqfEN This patch initialises the local variable 'shift' to zero to avoid improper extraction of ratio and pre-ratio divider values. Extraction of improper values was happening due to garbage value present in local variable. Signed-off-by: Amarendra Reddy Acked-by: Jaehoon Chung --- arch/arm/cpu/armv7/exynos/clock.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c index 731bbff..0bcf05f 100644 --- a/arch/arm/cpu/armv7/exynos/clock.c +++ b/arch/arm/cpu/armv7/exynos/clock.c @@ -379,7 +379,7 @@ static unsigned long exynos4_get_mmc_clk(int dev_index) (struct exynos4_clock *)samsung_get_base_clock(); unsigned long uclk, sclk; unsigned int sel, ratio, pre_ratio; - int shift; + int shift = 0; sel = readl(&clk->src_fsys); sel = (sel >> (dev_index << 2)) & 0xf; @@ -428,7 +428,7 @@ static unsigned long exynos5_get_mmc_clk(int dev_index) (struct exynos5_clock *)samsung_get_base_clock(); unsigned long uclk, sclk; unsigned int sel, ratio, pre_ratio; - int shift; + int shift = 0; sel = readl(&clk->src_fsys); sel = (sel >> (dev_index << 2)) & 0xf;