lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c1b29b3-25fb-0f84-ee04-5d9012a81f3f@gmail.com>
Date:   Thu, 16 Sep 2021 04:30:47 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Chanwoo Choi <cwchoi00@...il.com>
Cc:     linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-pm@...r.kernel.org,
        Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
        MyungJoo Ham <myungjoo.ham@...sung.com>,
        Stephen Boyd <sboyd@...nel.org>,
        Kyungmin Park <kyungmin.park@...sung.com>,
        Chanwoo Choi <cw00.choi@...sung.com>
Subject: Re: [PATCH v1 2/4] PM / devfreq: Add devm_devfreq_add_governor()

15.09.2021 21:23, Chanwoo Choi пишет:
> On 21. 9. 13. 오전 3:44, Dmitry Osipenko wrote:
>> Add resource-managed variant of devfreq_add_governor().
>>
>> Signed-off-by: Dmitry Osipenko <digetx@...il.com>
>> ---
>>   drivers/devfreq/devfreq.c  | 26 ++++++++++++++++++++++++++
>>   drivers/devfreq/governor.h |  3 +++
>>   2 files changed, 29 insertions(+)
>>
>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
>> index 85faa7a5c7d1..d3af000ec290 100644
>> --- a/drivers/devfreq/devfreq.c
>> +++ b/drivers/devfreq/devfreq.c
>> @@ -1301,6 +1301,32 @@ int devfreq_add_governor(struct
>> devfreq_governor *governor)
>>   }
>>   EXPORT_SYMBOL(devfreq_add_governor);
>>   +static void devm_devfreq_remove_governor(void *governor)
>> +{
>> +    devfreq_remove_governor(governor);
> 
> Because devfreq_remove_governor has the return value,
> you need to check the return value and then print error at least.
> 
>     WARN_ON(devfreq_remove_governor(governor));

...
>> diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h
>> index 2d69a0ce6291..0d70a9ad951e 100644
>> --- a/drivers/devfreq/governor.h
>> +++ b/drivers/devfreq/governor.h
>> @@ -94,4 +94,7 @@ static inline int devfreq_update_stats(struct
>> devfreq *df)
>>         return df->profile->get_dev_status(df->dev.parent,
>> &df->last_status);
>>   }
>> +
>> +int devm_devfreq_add_governor(struct device *dev,
>> +                  struct devfreq_governor *governor);
> 
> Better to add under devfreq_remove_governor definition in order to
> gather the similar functions.

I'll change it in v2, thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ