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

On 02/25/2013 05:07 AM, Emilio López wrote:
> 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);
>  }
> 
Thanks for the improvement.

Acked-By: Mark Langsdorf <mark.langsdorf@calxeda.com>

--Mark Langsdorf
Calxeda, Inc.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: mark.langsdorf@calxeda.com (Mark Langsdorf)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] cpufreq: highbank: do not initialize array with a loop
Date: Mon, 25 Feb 2013 07:53:47 -0600	[thread overview]
Message-ID: <512B6CEB.1030203@calxeda.com> (raw)
In-Reply-To: <1361790465-21760-1-git-send-email-emilio@elopez.com.ar>

On 02/25/2013 05:07 AM, Emilio L?pez wrote:
> 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);
>  }
> 
Thanks for the improvement.

Acked-By: Mark Langsdorf <mark.langsdorf@calxeda.com>

--Mark Langsdorf
Calxeda, Inc.

WARNING: multiple messages have this Message-ID (diff)
From: Mark Langsdorf <mark.langsdorf@calxeda.com>
To: "Emilio López" <emilio@elopez.com.ar>
Cc: "viresh.kumar@linaro.org" <viresh.kumar@linaro.org>,
	"rjw@sisk.pl" <rjw@sisk.pl>,
	"shawn.guo@linaro.org" <shawn.guo@linaro.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] cpufreq: highbank: do not initialize array with a loop
Date: Mon, 25 Feb 2013 07:53:47 -0600	[thread overview]
Message-ID: <512B6CEB.1030203@calxeda.com> (raw)
In-Reply-To: <1361790465-21760-1-git-send-email-emilio@elopez.com.ar>

On 02/25/2013 05:07 AM, Emilio López wrote:
> 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);
>  }
> 
Thanks for the improvement.

Acked-By: Mark Langsdorf <mark.langsdorf@calxeda.com>

--Mark Langsdorf
Calxeda, Inc.

  parent reply	other threads:[~2013-02-25 13:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24 17:01 [PATCH] cpufreq: highbank: do not initialize array with a loop Emilio López
2013-02-24 17:01 ` Emilio López
2013-02-24 17:01 ` Emilio López
2013-02-24 17:01 ` Emilio López
2013-02-25  3:41 ` Viresh Kumar
2013-02-25  3:41   ` Viresh Kumar
2013-02-25 10:58   ` Emilio López
2013-02-25 10:58     ` Emilio López
2013-02-25 10:58     ` Emilio López
2013-02-25 11:07 ` [PATCH v2] " Emilio López
2013-02-25 11:07   ` Emilio López
2013-02-25 11:07   ` Emilio López
2013-02-25 11:12   ` Viresh Kumar
2013-02-25 11:12     ` Viresh Kumar
2013-02-25 13:53   ` Mark Langsdorf [this message]
2013-02-25 13:53     ` Mark Langsdorf
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=512B6CEB.1030203@calxeda.com \
    --to=mark.langsdorf@calxeda.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=emilio@elopez.com.ar \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.