All of lore.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,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Arjan van de Ven <arjan@linux.intel.com>,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] PM: intel_powerclamp: off by one in start_power_clamp()
Date: Mon, 04 Feb 2013 01:44:36 +0000	[thread overview]
Message-ID: <1359942276.2250.32.camel@rzhang1-mobl4> (raw)
In-Reply-To: <20130124085122.GA3547@elgon.mountain>

On Thu, 2013-01-24 at 11:51 +0300, Dan Carpenter wrote:
> This value has already been clamped correctly to 0 through 49 in
> powerclamp_set_cur_state() so this patch doesn't actually change
> anything.  But we should fix it anyway for consistency.
> 
> set_target_ratio is used as an offset into an array with
> MAX_TARGET_RATIO (50) elements.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

applied to thermal-next.

BTW, Jacob, it would be good to get your comments on this as you're the
author of this driver.

thanks,
rui
> 
> diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/intel_powerclamp.c
> index a85ff38..ab3ed90 100644
> --- a/drivers/thermal/intel_powerclamp.c
> +++ b/drivers/thermal/intel_powerclamp.c
> @@ -504,7 +504,7 @@ static int start_power_clamp(void)
>  		return -EINVAL;
>  	}
>  
> -	set_target_ratio = clamp(set_target_ratio, 0U, MAX_TARGET_RATIO);
> +	set_target_ratio = clamp(set_target_ratio, 0U, MAX_TARGET_RATIO - 1);
>  	/* prevent cpu hotplug */
>  	get_online_cpus();
>  



WARNING: multiple messages have this Message-ID (diff)
From: Zhang Rui <rui.zhang@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-pm@vger.kernel.org,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Arjan van de Ven <arjan@linux.intel.com>,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] PM: intel_powerclamp: off by one in start_power_clamp()
Date: Mon, 04 Feb 2013 09:44:36 +0800	[thread overview]
Message-ID: <1359942276.2250.32.camel@rzhang1-mobl4> (raw)
In-Reply-To: <20130124085122.GA3547@elgon.mountain>

On Thu, 2013-01-24 at 11:51 +0300, Dan Carpenter wrote:
> This value has already been clamped correctly to 0 through 49 in
> powerclamp_set_cur_state() so this patch doesn't actually change
> anything.  But we should fix it anyway for consistency.
> 
> set_target_ratio is used as an offset into an array with
> MAX_TARGET_RATIO (50) elements.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

applied to thermal-next.

BTW, Jacob, it would be good to get your comments on this as you're the
author of this driver.

thanks,
rui
> 
> diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/intel_powerclamp.c
> index a85ff38..ab3ed90 100644
> --- a/drivers/thermal/intel_powerclamp.c
> +++ b/drivers/thermal/intel_powerclamp.c
> @@ -504,7 +504,7 @@ static int start_power_clamp(void)
>  		return -EINVAL;
>  	}
>  
> -	set_target_ratio = clamp(set_target_ratio, 0U, MAX_TARGET_RATIO);
> +	set_target_ratio = clamp(set_target_ratio, 0U, MAX_TARGET_RATIO - 1);
>  	/* prevent cpu hotplug */
>  	get_online_cpus();
>  



  reply	other threads:[~2013-02-04  1:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5100ee96.xoiaCavCYxXgoSIK%fengguang.wu@intel.com>
2013-01-24  8:51 ` [patch] PM: intel_powerclamp: off by one in start_power_clamp() Dan Carpenter
2013-01-24  8:51   ` Dan Carpenter
2013-02-04  1:44   ` Zhang Rui [this message]
2013-02-04  1:44     ` Zhang Rui

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=1359942276.2250.32.camel@rzhang1-mobl4 \
    --to=rui.zhang@intel.com \
    --cc=arjan@linux.intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=jacob.jun.pan@linux.intel.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 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.