public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] Thermal: cpufreq cooling: endian bug in cpufreq_get_max_state()
Date: Wed, 17 Apr 2013 15:45:53 +0000	[thread overview]
Message-ID: <1366213553.2091.70.camel@rzhang1-mobl4> (raw)
In-Reply-To: <20130417071828.GD7923@elgon.mountain>

On Wed, 2013-04-17 at 10:18 +0300, Dan Carpenter wrote:
> This code doesn't work on big endian systems because we're storing low
> values in the high bits of the unsigned long.  It makes it a very high
> value instead.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

applied to thermal -next.

thanks,
rui
> 
> diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
> index 5f5c780..768b508 100644
> --- a/drivers/thermal/cpu_cooling.c
> +++ b/drivers/thermal/cpu_cooling.c
> @@ -303,12 +303,12 @@ static int cpufreq_get_max_state(struct thermal_cooling_device *cdev,
>  	struct cpufreq_cooling_device *cpufreq_device = cdev->devdata;
>  	struct cpumask *mask = &cpufreq_device->allowed_cpus;
>  	unsigned int cpu;
> -	unsigned long count = 0;
> +	unsigned int count = 0;
>  	int ret;
>  
>  	cpu = cpumask_any(mask);
>  
> -	ret = get_property(cpu, 0, (unsigned int *)&count, GET_MAXL);
> +	ret = get_property(cpu, 0, &count, GET_MAXL);
>  
>  	if (count > 0)
>  		*state = count;



  reply	other threads:[~2013-04-17 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-17  7:18 [patch] Thermal: cpufreq cooling: endian bug in cpufreq_get_max_state() Dan Carpenter
2013-04-17 15:45 ` Zhang Rui [this message]
2013-04-17 16:55   ` Eduardo Valentin

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=1366213553.2091.70.camel@rzhang1-mobl4 \
    --to=rui.zhang@intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-pm@vger.kernel.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