[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0h7MiSJ+Sus1g8prBN3O6y98JDUPBQ=vjCQ1KG_yP22+A@mail.gmail.com>
Date: Wed, 29 Jul 2015 16:02:58 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Linux PM list <linux-pm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Russell King - ARM Linux <linux@....linux.org.uk>
Subject: Re: [Update 2x][PATCH 7/7] cpufreq: Separate CPU device registration
from CPU online
Hi Viresh,
On Wed, Jul 29, 2015 at 7:32 AM, Viresh Kumar <viresh.kumar@...aro.org> wrote:
> On 29-07-15, 03:03, Rafael J. Wysocki wrote:
>> +static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
>> +{
>> + unsigned cpu = dev->id;
>> + int ret;
>> +
>> + dev_dbg(dev, "%s: adding CPU%u\n", __func__, cpu);
>> +
>> + if (cpu_online(cpu)) {
>> + ret = cpufreq_online(cpu);
>
> I will do return right here ...
>
>> + } else {
>
> ... and this else will not be required anymore.
No.
You'd still need policy, so its definition and initialization would stay there.
The only thing you can save by doing that change is the ret variable,
but I like the code more the way it is.
>> + /*
>> + * A hotplug notifier will follow and we will handle it as CPU
>> + * online then. For now, just create the sysfs link, unless
>> + * there is no policy or the link is already present.
>> + */
>> + struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu);
>> +
>> + ret = policy && !cpumask_test_and_set_cpu(cpu, policy->real_cpus)
>> + ? add_cpu_dev_symlink(policy, cpu) : 0;
>> + }
>> +
>> + return ret;
>> +}
>
> Looks good otherwise.
>
> Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists