[RFC PATCH v2] ARM: imx: Add basic imx6q thermal management

Rob Lee rob.lee at linaro.org
Tue Jan 17 23:08:57 EST 2012


Sascha, one comment below.  Agree with the rest of your comments and a
v3 patch with these fixes will be coming shortly.

>> +static int th_sys_get_temp(struct thermal_zone_device *thermal,
>> +                               unsigned long *temp)
>> +{
>> +     int tmp = 0;
>> +
>> +     imx6q_get_temp(&tmp);
>> +
>> +     /*
>> +      * The thermal framework code stores temperature in unsigned long. Also,
>> +      * it has references to "millicelcius" which limits the lowest
>> +      * temperature possible (compared to Kelvin).
>> +      */
>> +     if (likely(tmp > 0))
>
> Please no 'likely' in such slow pathes.
>

Why limit 'likely' and 'unlikely' to fast paths?  There usage should
also increase efficiency and thus power usage when used in
periodically/repetitively called code such as this.  In this case, the
increased efficiency will be extremely small but what is the downside
to using it here?



More information about the linux-arm-kernel mailing list