linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-kernel@vger.kernel.org, sudeep.holla@arm.com,
	cristian.marussi@arm.com, rjw@rjwysocki.net,
	nicola.mazzucato@arm.com, linux-arm-kernel@lists.infradead.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] cpufreq: arm_scmi: Fix error path when allocation failed
Date: Tue, 3 Aug 2021 09:49:18 +0100	[thread overview]
Message-ID: <455e76f8-43c5-2976-e10b-a0fffeaee25f@arm.com> (raw)
In-Reply-To: <20210803043445.7sm4mnl4f5f7co7h@vireshk-i7>

Hi Viresh,

On 8/3/21 5:34 AM, Viresh Kumar wrote:
> On 02-08-21, 21:45, Lukasz Luba wrote:
>> Print warning and return an error which would stop the initialization
>> when cpumask allocation failed.
>>
>> Fixes: 80a064dbd556 ("scmi-cpufreq: Get opp_shared_cpus from opp-v2 for EM")
>> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
>> ---
>>   drivers/cpufreq/scmi-cpufreq.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
>> index ec9a87ca2dbb..b159123e68fd 100644
>> --- a/drivers/cpufreq/scmi-cpufreq.c
>> +++ b/drivers/cpufreq/scmi-cpufreq.c
>> @@ -133,8 +133,10 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
>>   		return -ENODEV;
>>   	}
>>   
>> -	if (!zalloc_cpumask_var(&opp_shared_cpus, GFP_KERNEL))
>> -		ret = -ENOMEM;
>> +	if (!zalloc_cpumask_var(&opp_shared_cpus, GFP_KERNEL)) {
>> +		dev_warn(cpu_dev, "failed to allocate cpumask\n");
> 
> We shouldn't be printing here anything I believe as the allocation
> core does it for us. That's why you won't see a print message anywhere
> for failed allocations.

Thanks for the comment. Let me send the v2.

      reply	other threads:[~2021-08-03  8:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 20:45 [PATCH] cpufreq: arm_scmi: Fix error path when allocation failed Lukasz Luba
2021-08-03  4:34 ` Viresh Kumar
2021-08-03  8:49   ` Lukasz Luba [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=455e76f8-43c5-2976-e10b-a0fffeaee25f@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=cristian.marussi@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nicola.mazzucato@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=sudeep.holla@arm.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).