Re: [PATCH] cpufreq: cached_resolved_idx can not be negative

2020-07-30 Thread Rafael J. Wysocki
On Thu, Jul 30, 2020 at 8:41 AM Viresh Kumar wrote: > > On 30-07-20, 12:02, Amit Kucheria wrote: > > Looking at this more closely, I found another call site for > > cpufreq_frequency_table_target() in cpufreq.c that needs the index to > > be unsigned int. > > > > But then cpufreq_frequency_table_t

Re: [PATCH] cpufreq: cached_resolved_idx can not be negative

2020-07-29 Thread Viresh Kumar
On 30-07-20, 12:02, Amit Kucheria wrote: > Looking at this more closely, I found another call site for > cpufreq_frequency_table_target() in cpufreq.c that needs the index to > be unsigned int. > > But then cpufreq_frequency_table_target() returns -EINVAL, so we It returns -EINVAL only in the cas

Re: [PATCH] cpufreq: cached_resolved_idx can not be negative

2020-07-29 Thread Amit Kucheria
On Thu, Jul 30, 2020 at 11:40 AM Viresh Kumar wrote: > > On 30-07-20, 11:29, Amit Kucheria wrote: > > On Thu, Jul 30, 2020 at 9:38 AM Viresh Kumar > > wrote: > > > > > > It is not possible for cached_resolved_idx to be invalid here as the > > > cpufreq core always sets index to a positive value.

Re: [PATCH] cpufreq: cached_resolved_idx can not be negative

2020-07-29 Thread Viresh Kumar
On 30-07-20, 11:29, Amit Kucheria wrote: > On Thu, Jul 30, 2020 at 9:38 AM Viresh Kumar wrote: > > > > It is not possible for cached_resolved_idx to be invalid here as the > > cpufreq core always sets index to a positive value. > > > > Change its type to unsigned int and fix qcom usage a bit. > >

Re: [PATCH] cpufreq: cached_resolved_idx can not be negative

2020-07-29 Thread Amit Kucheria
On Thu, Jul 30, 2020 at 9:38 AM Viresh Kumar wrote: > > It is not possible for cached_resolved_idx to be invalid here as the > cpufreq core always sets index to a positive value. > > Change its type to unsigned int and fix qcom usage a bit. Shouldn't you fix up idx in cpufreq_driver_resolve_freq(

[PATCH] cpufreq: cached_resolved_idx can not be negative

2020-07-29 Thread Viresh Kumar
It is not possible for cached_resolved_idx to be invalid here as the cpufreq core always sets index to a positive value. Change its type to unsigned int and fix qcom usage a bit. Signed-off-by: Viresh Kumar --- drivers/cpufreq/qcom-cpufreq-hw.c | 5 + include/linux/cpufreq.h | 2 +