From: Chanwoo Choi <cw00.choi@samsung.com>
To: Shawn Lin <shawn.lin@rock-chips.com>,
Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>
Cc: linux-pm@vger.kernel.org
Subject: Re: [PATCH] devfreq_cooling: no need to check state with negative number
Date: Tue, 23 Aug 2016 14:08:26 +0900 [thread overview]
Message-ID: <57BBDA4A.3030805@samsung.com> (raw)
In-Reply-To: <1471853286-10432-1-git-send-email-shawn.lin@rock-chips.com>
Hi,
On 2016년 08월 22일 17:08, Shawn Lin wrote:
> We could see that state is defined as unsigned type, so it
> should never be less than zero. Let' remove this check.
>
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> ---
>
> drivers/thermal/devfreq_cooling.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
> index 01f0015..81631b1 100644
> --- a/drivers/thermal/devfreq_cooling.c
> +++ b/drivers/thermal/devfreq_cooling.c
> @@ -312,7 +312,7 @@ static int devfreq_cooling_state2power(struct thermal_cooling_device *cdev,
> unsigned long freq;
> u32 static_power;
>
> - if (state < 0 || state >= dfc->freq_table_size)
> + if (state >= dfc->freq_table_size)
> return -EINVAL;
>
> freq = dfc->freq_table[state];
>
As the description, the 'state' variable is unsigned type.
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
--
Best Regards,
Chanwoo Choi
next prev parent reply other threads:[~2016-08-23 5:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20160822081333epcas1p1d61dc80a90c8961ac5fca0686bc79b48@epcas1p1.samsung.com>
2016-08-22 8:08 ` [PATCH] devfreq_cooling: no need to check state with negative number Shawn Lin
2016-08-23 5:08 ` Chanwoo Choi [this message]
2016-08-24 6:10 ` 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=57BBDA4A.3030805@samsung.com \
--to=cw00.choi@samsung.com \
--cc=edubezval@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
--cc=shawn.lin@rock-chips.com \
/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.