From patchwork Tue Mar 5 13:11:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amar X-Patchwork-Id: 15234 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 C61C923E00 for ; Tue, 5 Mar 2013 12:55:34 +0000 (UTC) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by fiordland.canonical.com (Postfix) with ESMTP id 60905A193A2 for ; Tue, 5 Mar 2013 12:55:34 +0000 (UTC) Received: by mail-ve0-f173.google.com with SMTP id oz10so5649054veb.4 for ; Tue, 05 Mar 2013 04:55:33 -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=zAh6BQQiqgBKFuEVIKwzEYgfaGYM82ymA3jYLohuFKw=; b=DbBzoFKyjSY3+dfuuuXRy5dR3rK1vEMZCMmCnpgGjGG7fGEDVnCd7meAfrEmUbtLk7 xWPIE6URAUszWEbMzj7l37OBqqZfw0H/37E5BnCt56ay4TNyXf21AOmIcCzWbfxXJjeV /yuQQ1AEbC1D3m7TnaHeNVtp/2SgJjCPRJDir8EziluemxzJuJ1VppuQJla6jj+bipl8 O9+LFoT6YXFxxRvV/1/LGUOuJy3hmUod9EoLS5eHjTTvT3hAsIg8ZtVovih2vHm4mhZn WPABAoJzj+juZJc8POmS3iuH1XQedYXh64/yrtVM1KueMZf1GevMWvtAwq4gvvcrM4nr fhQw== X-Received: by 10.220.39.69 with SMTP id f5mr9518239vce.45.1362488133886; Tue, 05 Mar 2013 04:55:33 -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.127.98 with SMTP id nf2csp109897veb; Tue, 5 Mar 2013 04:55:33 -0800 (PST) X-Received: by 10.50.150.167 with SMTP id uj7mr6158667igb.1.1362488132813; Tue, 05 Mar 2013 04:55:32 -0800 (PST) Received: from mailout2.samsung.com (mailout2.samsung.com. [203.254.224.25]) by mx.google.com with ESMTP id ni4si18487310igc.46.2013.03.05.04.55.32; Tue, 05 Mar 2013 04:55:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.25 as permitted sender) client-ip=203.254.224.25; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.25 as permitted sender) smtp.mail=amarendra.xt@samsung.com Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJ600AE1UKJ6R40@mailout2.samsung.com>; Tue, 05 Mar 2013 21:55:31 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 8E.CE.18793.34BE5315; Tue, 05 Mar 2013 21:55:31 +0900 (KST) X-AuditID: cbfee68f-b7f6a6d000004969-b8-5135eb435fc1 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id C7.71.03880.34BE5315; Tue, 05 Mar 2013 21:55:31 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([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 <0MJ600GDUUCXH840@mmp1.samsung.com>; Tue, 05 Mar 2013 21:55:31 +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 V7 05/10] EXYNOS5: DWMMC: Initialise the local variable to avoid unwanted results. Date: Tue, 05 Mar 2013 08:11:25 -0500 Message-id: <1362489090-7745-6-git-send-email-amarendra.xt@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1362489090-7745-1-git-send-email-amarendra.xt@samsung.com> References: <1362489090-7745-1-git-send-email-amarendra.xt@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsWyRsSkWtf5tWmgwYc1ShYP199ksZhy+AuL A5PHnWt72AIYo7hsUlJzMstSi/TtErgyHp1RL2jir1iwez5bA+Mani5GTg4JAROJJzuPMEHY YhIX7q1n62Lk4hASWMooMf/CW1aYojuz1zBDJBYxSvxZvpENJCEk0MskMf0NUIKDg01AVeLX YnuQsIiAhMSv/quMIPXMAh2MEjsmbmYESQgLpEh83rScHcRmAapf9LCdBcTmFXCXWPLpEDvE MjmJD3segdmcAh4Siz4vZIbY5S5xqWcRC8hQCYH7bBKbz69mhBgkIPFt8iEWkCMkBGQlNh1g hpgjKXFwxQ2WCYzCCxgZVjGKphYkFxQnpRcZ6xUn5haX5qXrJefnbmIEBuPpf8/6dzDePWB9 iDEZaNxEZinR5HxgMOeVxBsam5ibGpuaGVlaWpqSJqwkzit/SSZQSCA9sSQ1OzW1ILUovqg0 J7X4ECMTB6dUA6NNRsG8O0u36HN1sHc8Osm53Lh6So69wen6yr+B6pMO3fPMb+BPaXzONpOJ p2uFh0rTlbzwx7VOHsqJxbs4n6dpn1/w73qKZ6Nli5vUk+RS1xoJ7wmn+B67rJ7M/epoRYJi 9vnb74Oyb4tJcsfIOQkeV7tQ8U7vmyvDEoXsQvfJfwV1mPmOKrEUZyQaajEXFScCAB43y0Nc AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsVy+t9jAV3n16aBBpvnC1s8XH+TxWLK4S8s Dkwed67tYQtgjGpgtMlITUxJLVJIzUvOT8nMS7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLx CdB1y8wBmq2kUJaYUwoUCkgsLlbSt8M0ITTETdcCpjFC1zckCK7HyAANJKxhzHh0Rr2gib9i we75bA2Ma3i6GDk5JARMJO7MXsMMYYtJXLi3nq2LkYtDSGARo8Sf5RvZQBJCAr1MEtPfABVx cLAJqEr8WmwPEhYRkJD41X+VEaSeWaCDUWLHxM2MIAlhgRSJz5uWs4PYLED1ix62s4DYvALu Eks+HWKHWCYn8WHPIzCbU8BDYtHnhcwQu9wlLvUsYpnAyLuAkWEVo2hqQXJBcVJ6rpFecWJu cWleul5yfu4mRnCoP5PewbiqweIQowAHoxIPL8NRk0Ah1sSy4srcQ4wSHMxKIrw7n5oGCvGm JFZWpRblxxeV5qQWH2JMBrpqIrOUaHI+MA7zSuINjU3MTY1NLU0sTMwsSRNWEudlPPUkQEgg PbEkNTs1tSC1CGYLEwenVAOjUEA1y+wj+w+aHziSt3/Fbc8Ad+GMM38ZJBYz9K002JbrFd31 3ONOgsGS9Ypn3Z/uTrPoffLSPLaKpyGu50/ejXsrG/NSb5of8dWa8/hm0tVYle62w3ZXppT0 Je4UyLDtVrm5QGr7069XTxTrBV9ifrXyy3/VI26fGZJX+t5/kGj7Qon1ury1EktxRqKhFnNR cSIALKA9+LkCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQlOdvmW06JxWZv9WhUP3QYfV/f7ZN89z1w3bcDkCo20OkoaE1HLgQ2+cuulBTgNPc1Ykmts 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. Changes since V6: 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;