linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Subject: Re: [PATCH] cpufreq: fix overflow in cpufreq_table_find_index_dl()
Date: Tue, 18 Oct 2016 00:20:43 +0900	[thread overview]
Message-ID: <20161017152043.GA502@swordfish> (raw)
In-Reply-To: <20161017151456.3573-1-sergey.senozhatsky@gmail.com>

On (10/18/16 00:14), Sergey Senozhatsky wrote:
[..]
>  include/linux/cpufreq.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 5fa55fc..2a7aa0b 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -677,10 +677,10 @@ static inline int cpufreq_table_find_index_dl(struct cpufreq_policy *policy,
>  		if (best == table - 1)
>  			return pos - table;
>  
> -		return best - pos;
> +		return pos - best;
>  	}
>  
> -	return best - pos;
> +	return pos - best;
>  }

hmm.., you know what... I'm now actually curious,
why does it do `pos - best' and not `best - table'?

	-ss

  reply	other threads:[~2016-10-17 15:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 15:14 [PATCH] cpufreq: fix overflow in cpufreq_table_find_index_dl() Sergey Senozhatsky
2016-10-17 15:20 ` Sergey Senozhatsky [this message]
2016-10-17 15:41 ` [PATCHv2] " Sergey Senozhatsky
2016-10-18  6:37   ` Viresh Kumar

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=20161017152043.GA502@swordfish \
    --to=sergey.senozhatsky@gmail.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sergey.senozhatsky.work@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).