From patchwork Mon Jan 21 11:43:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amar X-Patchwork-Id: 14138 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 3AEBA23E02 for ; Mon, 21 Jan 2013 11:27:26 +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 B3B5DA18A32 for ; Mon, 21 Jan 2013 11:27:25 +0000 (UTC) Received: by mail-vb0-f41.google.com with SMTP id l22so1680888vbn.0 for ; Mon, 21 Jan 2013 03:27:25 -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=zJYqDgVxpEI1i62mAnMMHtVLcS7p1R/vkTxQx+dJgLo=; b=UHiJIpdpUUsFBnoPwNQci1wwbhJPxp+5iIQhqc7myGFH55auFbsyuF/3U1fHbl+gs4 BBjnM2y8A+/An1ZPFUocP22eVIGx/mGX67337Q+78S5aEBLYjwNCBCdMXSyshuo8NOqR jeIAoyuKPY5gd+5tkPS/zsnuLd8Q9z49px+bIltt9DXBRL8n5WkNer/bzAo1dwyCOxTF WO9hAJEKwOkFJKnSreUquPqk5ek6CGrSd6BxrpnzsXLnBCeL9ssGaTEouGwLdcW9MlAO 1z5BXWkCn9JJsoOZAtB7i0HzsGdM404FVJ8+Xkfg4AL76fJ6ktPAGJXNka05Ovu5kV24 DF0A== X-Received: by 10.52.18.147 with SMTP id w19mr16716638vdd.94.1358767645238; Mon, 21 Jan 2013 03:27:25 -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.58.145.101 with SMTP id st5csp196434veb; Mon, 21 Jan 2013 03:27:24 -0800 (PST) X-Received: by 10.68.132.232 with SMTP id ox8mr28839377pbb.46.1358767644249; Mon, 21 Jan 2013 03:27:24 -0800 (PST) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id uq10si13410528pbc.257.2013.01.21.03.27.23; Mon, 21 Jan 2013 03:27:24 -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 epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MGZ00IP23TLBCJ0@mailout1.samsung.com>; Mon, 21 Jan 2013 20:27:23 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id C6.53.03918.A162DF05; Mon, 21 Jan 2013 20:27:23 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-50-50fd261a972a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E5.53.03918.A162DF05; Mon, 21 Jan 2013 20:27:22 +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 <0MGZ0092C3L1A540@mmp2.samsung.com>; Mon, 21 Jan 2013 20:27:22 +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, hs@denx.de Subject: [PATCH V5 05/10] EXYNOS5: DWMMC: Initialise the local variable to avoid unwanted results. Date: Mon, 21 Jan 2013 06:43:53 -0500 Message-id: <1358768638-14187-6-git-send-email-amarendra.xt@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1358768638-14187-1-git-send-email-amarendra.xt@samsung.com> References: <1358768638-14187-1-git-send-email-amarendra.xt@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsWyRsSkWlda7W+AwbLfrBYP199ksZhy+AuL A5PHnWt72AIYo7hsUlJzMstSi/TtErgy+m/MYSw4w1dxcvF55gbG69xdjBwcEgImEg9+OXQx cgKZYhIX7q1n62Lk4hASWMoocf3NezaIhInElR+XmSES0xklrt5sZIRwepkkVt6eyggyiU1A VeLXYnuQBhEBA4npT7azgtjMAjUSk+ffYgKxhQVSJJo/TwaLswCVd6ydDRbnFfCQuHB6NivE MjmJD3sesYPYnAKeEvv/7gGLCwHV7FrwnxVkr4TAbTaJWYcus0MMEpD4NvkQC8Q3shKbDjBD zJGUOLjiBssERuEFjAyrGEVTC5ILipPScw31ihNzi0vz0vWS83M3MQKD8fS/Z1I7GFc2WBxi FOBgVOLhzZj6J0CINbGsuDL3EKMEB7OSCO/PGUAh3pTEyqrUovz4otKc1OJDjMlAyycyS4km 5wMjJa8k3tDYxNzU2NTSyMjM1JQ0YSVxXsZTTwKEBNITS1KzU1MLUotgtjBxcEo1MPY3mi/I nThzd2uMoY2uQ9GF9/ec1p5WWhap6a7qmPbjNu+WvZcu2WxeetNwRc1u7l16210Ent456q5Y 8aU29+Utluz9KRNnS1+xFFFmkpwib9yVceLcSqkrslfSYv3uTJq2aPkd06JtLzJPzc9/bKpl 9OdLnNyy677BMRLbqnmbz96udS4Kq1RiKc5INNRiLipOBAD3keKdigIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRmVeSWpSXmKPExsVy+t9jQV0ptb8BBt/2mVs8XH+TxWLK4S8s Dkwed67tYQtgjGpgtMlITUxJLVJIzUvOT8nMS7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLx CdB1y8wBmq2kUJaYUwoUCkgsLlbSt8M0ITTETdcCpjFC1zckCK7HyAANJKxhzOi/MYex4Axf xcnF55kbGK9zdzFyckgImEhc+XGZGcIWk7hwbz1bFyMXh5DAdEaJqzcbGSGcXiaJlbenAjkc HGwCqhK/FtuDNIgIGEhMf7KdFcRmFqiRmDz/FhOILSyQItH8eTJYnAWovGPtbLA4r4CHxIXT s1khlslJfNjziB3E5hTwlNj/dw9YXAioZteC/6wTGHkXMDKsYhRNLUguKE5KzzXUK07MLS7N S9dLzs/dxAgO9mdSOxhXNlgcYhTgYFTi4c2Y+idAiDWxrLgy9xCjBAezkgjvzxlAId6UxMqq 1KL8+KLSnNTiQ4zJQFdNZJYSTc4HRmJeSbyhsYm5qbGppYmFiZklacJK4ryMp54ECAmkJ5ak ZqemFqQWwWxh4uCUamDMN08Vlgi5s9jzxoyX60o+7XoZqL8y2O3uBp+o/puSc75LTPh1y2UB S6HETjuBx9P3FLtJvl+84t6y35HXlucumrhDdcuvx44Mv6Y1Nbz4lPAiwidg05vQS1Om5+89 zDT96pQP20wSna7sU4hfJ2psLWyiunzmiTr7Ob8m83Decfr6P9N6Wj/TRCWW4oxEQy3mouJE AJvNtMq6AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQmTRRthQoCG6biZDIhMvuy9xyc9WYsafByv/lSaTxrKP//+7Bao0MWQ8FfNMkGoKmOjUl6X 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. 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;