lkml.org 
[lkml]   [2020]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 3/5] thermal: devfreq_cooling: add new registration functions with Energy Model
From
Date
Hi Ionela,

On 12/2/20 10:24 AM, Ionela Voinescu wrote:
> Hi Lukasz,
>
> On Wednesday 18 Nov 2020 at 12:03:56 (+0000), Lukasz Luba wrote:

[snip]

>> + struct device_node *np = NULL;

[snip]

>> +
>> + if (dev->of_node)
>> + np = of_node_get(dev->of_node);
>> +
>
> Should np be checked before use? I'm not sure if it's better to do the
> assign first and then the check on np before use. It depends on the
> consequences of passing a NULL node pointer later on.

The np is actually dev->of_node (or left NULL, as set at the begging).
The only meaning of the line above is to increment the counter and then
decrement if CONFIG_OF_DYNAMIC was used.
The devfreq_cooling_register() has np = NULL and the registration can
handle it, so we should be OK here as well.

>
>> + cdev = of_devfreq_cooling_register_power(np, df, dfc_power);
>> +
>> + if (np)
>> + of_node_put(np);
>> +

[snip]

>>
>
> Otherwise it looks good to me:
>
> Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com>

Thank you for the review.

Regards,
Lukasz

>
> Ionela.
>

\
 
 \ /
  Last update: 2020-12-02 12:16    [W:0.102 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site