From patchwork Wed Apr 3 14:08:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amar X-Patchwork-Id: 233473 X-Patchwork-Delegate: promsoft@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C04262C0099 for ; Thu, 4 Apr 2013 00:52:14 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C91224A1C8; Wed, 3 Apr 2013 15:52:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g0Z27HDCwowZ; Wed, 3 Apr 2013 15:52:12 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D1F924A1DA; Wed, 3 Apr 2013 15:52:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DE7DB4A1DA for ; Wed, 3 Apr 2013 15:52:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VtzocUu6pgvt for ; Wed, 3 Apr 2013 15:52:08 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by theia.denx.de (Postfix) with ESMTP id BE5E34A1C8 for ; Wed, 3 Apr 2013 15:52:07 +0200 (CEST) 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 <0MKO000DAMIUNF10@mailout1.samsung.com> for u-boot@lists.denx.de; Wed, 03 Apr 2013 22:52:06 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.122]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 26.69.20872.5043C515; Wed, 03 Apr 2013 22:52:05 +0900 (KST) X-AuditID: cbfee68d-b7f786d000005188-ac-515c3405d32c Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id DE.B1.13494.5043C515; Wed, 03 Apr 2013 22:52: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 <0MKO00KW6MDEHT20@mmp2.samsung.com>; Wed, 03 Apr 2013 22:52:05 +0900 (KST) From: Amar To: u-boot@lists.denx.de, mk7.kang@samsung.com Date: Wed, 03 Apr 2013 10:08:29 -0400 Message-id: <1364998113-13428-6-git-send-email-amarendra.xt@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1364998113-13428-1-git-send-email-amarendra.xt@samsung.com> References: <1364998113-13428-1-git-send-email-amarendra.xt@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHLMWRmVeSWpSXmKPExsWyRsSkSpfVJCbQYNUqG4sb13+yWTxcf5PF 4savNlaLjiMtjBZTDn9hsfi2ZRujxfLXG9kt3u7tZHfg8JjdcJHFY+esu+weCzaVety5tofN 4+ydHYwefVtWMQawRXHZpKTmZJalFunbJXBlLJ/bwFiwhL9idYdTA+MRni5GTg4JAROJM5cX sEPYYhIX7q1nA7GFBJYySjxfnQ1Ts+DWF6A4F1B8OqPE3lWvWSGcXiaJnbs/M3YxcnCwCahK /FpsD9IgIqAnMW/SO7AGZoEeoIalV5lAaoQFki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FpTmpxYcYk4GumsgsJZqcD4z5vJJ4Q2MTc1NjU0sTCxMzS9KElcR5D7ZaBwoJ pCeWpGanphakFsFsYeLglGpgXDDVbprhzVqFrMV6IclOr9YJqfFufGW04pnDBQPNoIy/hdkr P56bEC35TP+S8Z23ti/ThdP6Yo7wcHS+X8JaJBXPWzLN7ezCyokyBQ8inygoGj5jcLfQrO97 JP657nqO94piRYPwy7Nz+LwMZLQjFpkUv+ZOub8zJ6dwoaIw+7TLyUu5LqkpsRRnJBpqMRcV JwIAPMhci+8CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: u-boot-review@google.com, patches@linaro.org, jh80.chung@samsung.com, afleming@gmail.com Subject: [U-Boot] [PATCH V8 5/9] EXYNOS5: DWMMC: Initialise the local variable to avoid unwanted results. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Acked-by: Jaehoon Chung --- 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. Changes since V6: No change. Changes since V7: 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 223660a..cf3247a 100644 --- a/arch/arm/cpu/armv7/exynos/clock.c +++ b/arch/arm/cpu/armv7/exynos/clock.c @@ -613,7 +613,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; @@ -662,7 +662,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;