mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Emilio López" <emilio@elopez.com.ar>
To: viresh.kumar@linaro.org, rjw@sisk.pl, shawn.guo@linaro.org,
	mark.langsdorf@calxeda.com
Cc: linux-arm-kernel@lists.infradead.org, cpufreq@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Emilio López" <emilio@elopez.com.ar>
Subject: [PATCH v2] cpufreq: highbank: do not initialize array with a loop
Date: Mon, 25 Feb 2013 08:07:45 -0300	[thread overview]
Message-ID: <1361790465-21760-1-git-send-email-emilio@elopez.com.ar> (raw)
In-Reply-To: <1361725277-5125-1-git-send-email-emilio@elopez.com.ar>

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 <emilio@elopez.com.ar>
---

Note that I don't own any device using this driver, it has only been compile
tested, but it shouldn't cause any issues.

Changes v1 -> v2:
  * Move freq / 1000000 to the array definition as suggested by Viresh Kumar

 drivers/cpufreq/highbank-cpufreq.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/cpufreq/highbank-cpufreq.c b/drivers/cpufreq/highbank-cpufreq.c
index 66e3a71..b61b5a3 100644
--- a/drivers/cpufreq/highbank-cpufreq.c
+++ b/drivers/cpufreq/highbank-cpufreq.c
@@ -28,13 +28,7 @@
 
 static int hb_voltage_change(unsigned int freq)
 {
-	int i;
-	u32 msg[HB_CPUFREQ_IPC_LEN];
-
-	msg[0] = HB_CPUFREQ_CHANGE_NOTE;
-	msg[1] = freq / 1000000;
-	for (i = 2; i < HB_CPUFREQ_IPC_LEN; i++)
-		msg[i] = 0;
+	u32 msg[HB_CPUFREQ_IPC_LEN] = {HB_CPUFREQ_CHANGE_NOTE, freq / 1000000};
 
 	return pl320_ipc_transmit(msg);
 }
-- 
1.8.2.rc0


  parent reply	other threads:[~2013-02-25 11:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24 17:01 [PATCH] " Emilio López
2013-02-25  3:41 ` Viresh Kumar
2013-02-25 10:58   ` Emilio López
2013-02-25 11:07 ` Emilio López [this message]
2013-02-25 11:12   ` [PATCH v2] " Viresh Kumar
2013-02-25 13:53   ` Mark Langsdorf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361790465-21760-1-git-send-email-emilio@elopez.com.ar \
    --to=emilio@elopez.com.ar \
    --cc=cpufreq@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.langsdorf@calxeda.com \
    --cc=rjw@sisk.pl \
    --cc=shawn.guo@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®