Re: [PATCH] cpufreq: cpufreq_stats: make last_index signed int

2017-09-19 Thread Viresh Kumar
On 18-09-17, 10:39, Bo Yan wrote: > Currently, the "last_index" is being checked before > cpufreq_stats_update(stats) inside function > "cpufreq_stats_record_transition", so it's taken care of. > > However, the function "show_time_in_state" also calls cpufreq_stats_update, > the similar check shou

Re: [PATCH] cpufreq: cpufreq_stats: make last_index signed int

2017-09-18 Thread Bo Yan
On 09/17/2017 06:50 PM, Viresh Kumar wrote: On 15-09-17, 13:13, Bo Yan wrote: It is possible for last_index to get a -1 if current frequency is not found in the freq table when stats is created. If the function "cpufreq_stats_update" is called before last_index is updated with a valid value, the

Re: [PATCH] cpufreq: cpufreq_stats: make last_index signed int

2017-09-17 Thread Viresh Kumar
On 15-09-17, 13:13, Bo Yan wrote: > It is possible for last_index to get a -1 if current frequency > is not found in the freq table when stats is created. If the > function "cpufreq_stats_update" is called before last_index is > updated with a valid value, the "-1" will be used as index to > update

[PATCH] cpufreq: cpufreq_stats: make last_index signed int

2017-09-15 Thread Bo Yan
It is possible for last_index to get a -1 if current frequency is not found in the freq table when stats is created. If the function "cpufreq_stats_update" is called before last_index is updated with a valid value, the "-1" will be used as index to update stats->time_in_state, triggering an excepti