From patchwork Fri Feb 15 06:34:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amar X-Patchwork-Id: 14819 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 7DC2F23FC2 for ; Fri, 15 Feb 2013 06:14:09 +0000 (UTC) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by fiordland.canonical.com (Postfix) with ESMTP id 2177EA18048 for ; Fri, 15 Feb 2013 06:14:09 +0000 (UTC) Received: by mail-vb0-f41.google.com with SMTP id l22so2018587vbn.0 for ; Thu, 14 Feb 2013 22:14:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-auditid:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-brightmail-tracker:x-brightmail-tracker :dlp-filter:x-mtr:x-cfilter-loop:x-gm-message-state; bh=HFt+ptRxXWrbqUA1zKIJyGY4xt+NIkLZnO+jo7LuzMs=; b=GDdsR5ERG3++ymSrAFuKyebweNpRl7a7o4WUlhzV9SnMBSUeRJRW4rHlk/Jh1T2044 w2x75zWIIiU3jGQbh8RIe9wNwGvmjRedEDPgXYcR9X02LWnDnfYvcijrj9BLPa7eMUxu 5HmrnpotqWxWldfEvfZCFcobbFfcMwqhBQWYGmu4ByE5PUrNuJ+3TvpkIv54I36Q8YLF WIuGODZ+BMDvWvDs7ZHPDGSL8P4MJ/cIJto+cP2fneLfsl1WMeJVljE8BF7weWRu/zEG /+qxzkRLL2wMkz4K/P8amMWEdH3YZ3XFXPnRTXRGzphctgpMerTggpt47x4qlEM35g5l 2xZw== X-Received: by 10.52.69.74 with SMTP id c10mr1593303vdu.3.1360908848361; Thu, 14 Feb 2013 22:14:08 -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.221.4.5 with SMTP id oa5csp305011vcb; Thu, 14 Feb 2013 22:14:07 -0800 (PST) X-Received: by 10.68.189.234 with SMTP id gl10mr3228738pbc.148.1360908847567; Thu, 14 Feb 2013 22:14:07 -0800 (PST) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id qx5si3674148pbc.114.2013.02.14.22.14.07; Thu, 14 Feb 2013 22:14:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.24 as permitted sender) client-ip=203.254.224.24; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.24 as permitted sender) smtp.mail=amarendra.xt@samsung.com Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MI800J4GZZ1VHN0@mailout1.samsung.com>; Fri, 15 Feb 2013 15:14:06 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 1F.AB.16905.D22DD115; Fri, 15 Feb 2013 15:14:05 +0900 (KST) X-AuditID: cbfee68d-b7f4f6d000004209-44-511dd22d9bcd Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id BF.8A.03918.D22DD115; Fri, 15 Feb 2013 15:14:05 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MI8005Z0ZYZ7R20@mmp2.samsung.com>; Fri, 15 Feb 2013 15:14:05 +0900 (KST) From: Amar To: u-boot@lists.denx.de Cc: patches@linaro.org, sjg@chromium.org, mk7.kang@samsung.com, chander.kashyap@linaro.org, afleming@gmail.com, jh80.chung@samsung.com Subject: [PATCH V6 05/10] EXYNOS5: DWMMC: Initialise the local variable to avoid unwanted results. Date: Fri, 15 Feb 2013 01:34:46 -0500 Message-id: <1360910091-6285-6-git-send-email-amarendra.xt@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1360910091-6285-1-git-send-email-amarendra.xt@samsung.com> References: <1360910091-6285-1-git-send-email-amarendra.xt@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsWyRsSkWlf3kmygwfLpuhYP199ksZhy+AuL A5PHnWt72AIYo7hsUlJzMstSi/TtErgymt+9Zi14wFex59JCpgbGKTxdjJwcEgImEpMvtjBC 2GISF+6tZ+ti5OIQEljKKDF/UwMrTNGFRX2MEInpjBIfDm1ghXB6mST6X85l6WLk4GATUJX4 tdgepEFEQELiV/9VsAZmgQ5GiR0TN4OtEBZIkejuec8MYrMA1d+++JgdxOYVcJdYvOwa1DY5 iQ97HoHFOQU8JM5Nfg1WLwRUs/NTB9hQCYH7bBJTO1axQgwSkPg2+RDYERICshKbDjBDzJGU OLjiBssERuEFjAyrGEVTC5ILipPSiwz1ihNzi0vz0vWS83M3MQID8vS/Z707GG8fsD7EmAw0 biKzlGhyPjCg80riDY1NzE2NTc2MLC0tTUkTVhLnlbskEygkkJ5YkpqdmlqQWhRfVJqTWnyI kYmDU6qB8Z6zroeEdLS76vyOKI1lfSKT3szLZDz3uzwwzzzMQFfn9IKKoJ91FTI20drODn3S EmrJHekOp2ONa+fqrPGwjN4v4Fslq/Fl8z1daU92lhVvT9VfTt9memDmE5lTK7umfLv0/c69 qyK9y87zCsTf5JV7+XNd5xbHXOHF6ZoHNqXNemQv+cxTiaU4I9FQi7moOBEAvy/Pdl4CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRmVeSWpSXmKPExsVy+t9jQV3dS7KBBp8+K1k8XH+TxWLK4S8s Dkwed67tYQtgjGpgtMlITUxJLVJIzUvOT8nMS7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLx CdB1y8wBmq2kUJaYUwoUCkgsLlbSt8M0ITTETdcCpjFC1zckCK7HyAANJKxhzGh+95q14AFf xZ5LC5kaGKfwdDFyckgImEhcWNTHCGGLSVy4t56ti5GLQ0hgOqPEh0MbWCGcXiaJ/pdzWboY OTjYBFQlfi22B2kQEZCQ+NV/lRGkhlmgg1Fix8TNYJOEBVIkunveM4PYLED1ty8+ZgexeQXc JRYvu8YKsU1O4sOeR2BxTgEPiXOTX4PVCwHV7PzUwTiBkXcBI8MqRtHUguSC4qT0XEO94sTc 4tK8dL3k/NxNjOBwfya1g3Flg8UhRgEORiUeXgEJ2UAh1sSy4srcQ4wSHMxKIrxrQoBCvCmJ lVWpRfnxRaU5qcWHGJOBrprILCWanA+MxbySeENjE3NTY1NLEwsTM0vShJXEeRlPPQkQEkhP LEnNTk0tSC2C2cLEwSnVwLj495I908V4Jjy9lnVMx6Ag7vvDI5F3T3TJTmjgsgzkqjjebSeW 6v7337VDlWd2Js+6Fac8Ye5jo3MXDlzv/JbDwpBTqLct/VrmCzGxs7ELGdZXKEUdzPbdwHUw /rmQ39rMOxJ/mv9serBU3WXDUyMJNcdb2blX50qI972uurHMhulXucr7b6JKLMUZiYZazEXF iQB4uOEjuwIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQn/Wu0wC+TE2RPRPSf+SDN1NCAF/Yrv7r/bBxxwAbSSqAdCFuGyC18arGsj9bqibG+CuizH This patch initialises the local variable 'shift' to zero. The uninitialised local variable 'shift' had garbage value and was resulting in unwnated results in the functions exynos5_get_mmc_clk() and exynos4_get_mmc_clk(). Signed-off-by: Amar Acked-by: Simon Glass --- Changes since V1: 1)Updated the function exynos5_mmc_set_clk_div() to receive 'device_i'd as input parameter instead of 'index'. Changes since V2: 1)Updation of commit message and resubmition of proper patch set. Changes since V3: 1)Removed the new API exynos5_mmc_set_clk_div() from clock.c, because existing API set_mmc_clk() can be used to set mmc clock. Changes since V4: 1)Updated the subject line to reflect the changes present in this patch. 2)Changes of the file arch/arm/include/asm/arch-exynos/clk.h which were present in this patch, have been moved out of this patch. Changes since V5: No change. arch/arm/cpu/armv7/exynos/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c index 956427c..edce21c 100644 --- a/arch/arm/cpu/armv7/exynos/clock.c +++ b/arch/arm/cpu/armv7/exynos/clock.c @@ -490,7 +490,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; @@ -539,7 +539,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;