On 13/04/2018 13:38, Daniel Thompson wrote:

[ ... ]

>> +            /*
>> +             * Allocate the cpuidle cooling device with the list
>> +             * of the cpus belonging to the cluster.
>> +             */
>> +            idle_cdev = cpuidle_cooling_alloc(topology_core_cpumask(cpu));
>> +            if (!idle_cdev)
>> +                    goto out;
> 
> Perhaps nitpicking but it might be better to set ret to -ENOMEM here 
> and avoid initializing it during the declarations.
> 
> There's no bug in the current form since ret is never assigned to
> outside of the error paths, but the unwritten assumption that ret keeps
> its original value throughout the loop seems like a bit of a landmine
> w.r.t. future maintainance.

Agree.

-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Reply via email to