From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Lezcano Subject: Re: [PATCH v3 6/7] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver Date: Wed, 11 Apr 2018 11:29:53 +0200 Message-ID: References: <1522945005-7165-1-git-send-email-daniel.lezcano@linaro.org> <1522945005-7165-7-git-send-email-daniel.lezcano@linaro.org> <20180411085130.GN7671@vireshk-i7> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20180411085130.GN7671@vireshk-i7> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Viresh Kumar Cc: edubezval@gmail.com, kevin.wangtao@linaro.org, leo.yan@linaro.org, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, javi.merino@kernel.org, rui.zhang@intel.com, daniel.thompson@linaro.org, linux-pm@vger.kernel.org, Amit Daniel Kachhap List-Id: linux-pm@vger.kernel.org Hi Viresh, thanks for the review. On 11/04/2018 10:51, Viresh Kumar wrote: [ ... ] >> +void __init cpuidle_cooling_register(void) >> +{ >> + struct cpuidle_cooling_device *idle_cdev = NULL; >> + struct thermal_cooling_device *cdev; >> + struct device_node *np; >> + cpumask_var_t cpumask; > > maybe call it clustermask ? Yeah, sounds better. >> + cdev = thermal_of_cooling_device_register(np, dev_name, >> + idle_cdev, >> + &cpuidle_cooling_ops); >> + if (IS_ERR(cdev)) { >> + ret = PTR_ERR(cdev); >> + goto out; >> + } >> + >> + idle_cdev->cdev = cdev; >> + cpumask_set_cpu(cluster_id, cpumask); >> + } >> + >> + ret = smpboot_register_percpu_thread(&cpuidle_cooling_threads); >> + if (ret) >> + goto out; >> + >> + pr_info("Created cpuidle cooling device\n"); >> +out: >> + free_cpumask_var(cpumask); >> + >> + if (ret) { >> + cpuidle_cooling_unregister(); >> + pr_err("Failed to create idle cooling device (%d)\n", ret); >> + } > > Maybe rearrange it a bit: > > + ret = smpboot_register_percpu_thread(&cpuidle_cooling_threads); > + > +out: > + if (ret) { > + cpuidle_cooling_unregister(); > + pr_err("Failed to create idle cooling device (%d)\n", ret); > + } else { > + pr_info("Created cpuidle cooling devices\n"); > + } > + > + free_cpumask_var(cpumask); > > ?? I usually tend to avoid using 'else' statements when possible (a coding style practice) but if you prefer this version I'm fine with that. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog