From patchwork Sun Feb 24 17:01:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Emilio_L=C3=B3pez?= X-Patchwork-Id: 222775 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 245BB2C0293 for ; Mon, 25 Feb 2013 04:08:18 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U9f0U-0008Mz-M4; Sun, 24 Feb 2013 17:04:58 +0000 Received: from avas-mr14.fibertel.com.ar ([24.232.0.245]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U9f0P-0008M8-Is for linux-arm-kernel@lists.infradead.org; Sun, 24 Feb 2013 17:04:55 +0000 Received: from 201-212-118-238.prima.net.ar ([201.212.118.238]:52648 "EHLO desktop.lan" smtp-auth: "elopez" rhost-flags-OK-OK-OK-FAIL) by avas-mr14.fibertel.com.ar with ESMTPA id S410290Ab3BXREg; Sun, 24 Feb 2013 14:04:36 -0300 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= To: rjw@sisk.pl, shawn.guo@linaro.org, mark.langsdorf@calxeda.com Subject: [PATCH] cpufreq: highbank: do not initialize array with a loop Date: Sun, 24 Feb 2013 14:01:17 -0300 Message-Id: <1361725277-5125-1-git-send-email-emilio@elopez.com.ar> X-Mailer: git-send-email 1.8.2.rc0 MIME-Version: 1.0 X-Fib-Al-Info: Al X-Fib-Al-MRId: 2213ec4be6a97ec6a50fde3c87c48f80 X-Fib-Al: noav X-Fib-Al-SA: analyzed X-Fib-Al-From: emilio@elopez.com.ar X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130224_120454_074424_43C647D9 X-CRM114-Status: UNSURE ( 7.50 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 3.3 (+++) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (3.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [24.232.0.245 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 2.5 TAB_IN_FROM From starts with a tab 2.8 KB_DATE_CONTAINS_TAB KB_DATE_CONTAINS_TAB Cc: =?UTF-8?q?Emilio=20L=C3=B3pez?= , linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org As uninitialized array members will be initialized to zero, we can avoid using a for loop by setting a value to it. Signed-off-by: Emilio López --- Note that I don't own any device using this driver, it has only been compile tested, but it shouldn't cause any issues. drivers/cpufreq/highbank-cpufreq.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/cpufreq/highbank-cpufreq.c b/drivers/cpufreq/highbank-cpufreq.c index 66e3a71..30d4ae1 100644 --- a/drivers/cpufreq/highbank-cpufreq.c +++ b/drivers/cpufreq/highbank-cpufreq.c @@ -28,13 +28,9 @@ static int hb_voltage_change(unsigned int freq) { - int i; - u32 msg[HB_CPUFREQ_IPC_LEN]; + u32 msg[HB_CPUFREQ_IPC_LEN] = {HB_CPUFREQ_CHANGE_NOTE}; - msg[0] = HB_CPUFREQ_CHANGE_NOTE; msg[1] = freq / 1000000; - for (i = 2; i < HB_CPUFREQ_IPC_LEN; i++) - msg[i] = 0; return pl320_ipc_transmit(msg); }