Received: by 10.192.165.156 with SMTP id m28csp494038imm; Wed, 11 Apr 2018 02:34:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx49zmidhj+G0TskmbSmBUFddkpg+KhTz3QczgRsCr7GskcHRznzw41NBLplX3yGmeACfh485 X-Received: by 2002:a17:902:52a4:: with SMTP id a33-v6mr4239394pli.371.1523439288498; Wed, 11 Apr 2018 02:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523439288; cv=none; d=google.com; s=arc-20160816; b=rrG+BEIagHdu5PBCTPDzzLi6/WalXxAma00OIJOcg1USo4gX+PzAZt+Vfl4nuMeIbS vqdKqrVLbJqh3D00djbaI+a3Hcg1SFyar8JcxKHlGXM2TLzGArIpgmpUov7S0XaD/6Ls xmad4d3GYgzdPwhtZ5n3U5aT7UV5Fp6Phj78Xf2RmHPUNo93HEUUxSC8PRk/TLcJrPNU oAIcY1BDN9vWkeeheKS0v7N/FT+iMAsv0oUowCg1pDTUMxxR6qXYrWoAXIeUPtl8f2wL sI+eZlTS9hr9H7OwrayO1LwaALEe9DWs6p4Xkbi2fnKIHF/kOoD68iam3qKrFGjZxl/Y a/Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=kkh5Smo0dDUFjBFN325mBj2ylmnfIaPqARWnWcKTASQ=; b=IgWGCns3hBnl5Tg7nMICoLf8scbL1fZZtLJTHGPEGDw7DEdzipVn6G/hhClsAKrzmX rHMbBdvt4mcazc3OFLXpLRMoi5vSD8bFUezo24Vrt4so/Uo/zLs4at8dTRU8rPAwR/Wp Kalr1ojfzoGLvdBacrMN+qSGI8FbDjNb3rGond9D+AqVE0gyQf9IEZr2nACWhjKwYiqH 33+/vaowRlZrDupV0ydJq4GGMvN/OTRfWpo3YrEFukkHQmL/RHCKfkhgdiIuFHd94/kN QgKKYEiRQqRHTp1P+dW4seAT2ydX3CUVDA8rk1EoAEBOyOTAShIPI4bvfL974Xz3wdmh izCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WRyDfYMT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20si473944pgd.716.2018.04.11.02.34.11; Wed, 11 Apr 2018 02:34:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WRyDfYMT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbeDKJ36 (ORCPT + 99 others); Wed, 11 Apr 2018 05:29:58 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:33820 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751883AbeDKJ34 (ORCPT ); Wed, 11 Apr 2018 05:29:56 -0400 Received: by mail-wr0-f170.google.com with SMTP id d19so1068936wre.1 for ; Wed, 11 Apr 2018 02:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kkh5Smo0dDUFjBFN325mBj2ylmnfIaPqARWnWcKTASQ=; b=WRyDfYMToqSiFOE0GHQdgNFKf9WMc7DUCDXEguif5E3Jp7sCd8U9hduevYy+SwUN/H sX0fVEj1dgq7EaR0TtFu6N/JJYmot3upromqFL04C8bDpCXBi0EZs1TfcvkIpj1/+OPQ POF6qw2S3FhiJ2sHrpkPg5Om7PpfjoCCToMt4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kkh5Smo0dDUFjBFN325mBj2ylmnfIaPqARWnWcKTASQ=; b=EN3bgTdn+wvMcisyCBeGrYMBvlamVQCZFFWEh1D/o4KVJ9squXVrpteFLb6R0qbAu5 /mQ1WBIQeeseELiczTs2XsaMzzk3js4C62C7SxlYGYTLh4R6VZ6itmXKWj5OT79E95Az Q8Mf035ZjgQ1IMzDXREsTy9UiSKzOFVvOdqwsKMkDn9deA5Y4blrlYmiOnVbCSQ3v7px xss4v9pFOxAjCMWvhYf2zlFp6XPB0l+HyKGdj2dqHG+nsK8KcLxYE2aMClQvqtwuVVqk 0wnO3j6AKLw/m6iqlAgOzVSzdIaRStBu9PG53GWV9byCuMmvxmFgYZW5qVBN5ialIM2r 4uXw== X-Gm-Message-State: ALQs6tDWGq83C1pRKegX9StJfRCw8K1YHlfSDpJuv1lccgqviHDl4BNI hssyQPJE3gF48qiOipVUz5NTUw== X-Received: by 10.223.169.54 with SMTP id u51mr2651827wrc.71.1523438995209; Wed, 11 Apr 2018 02:29:55 -0700 (PDT) Received: from [192.168.1.75] (lft31-1-88-121-166-205.fbx.proxad.net. [88.121.166.205]) by smtp.googlemail.com with ESMTPSA id t69sm1092574wrc.87.2018.04.11.02.29.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Apr 2018 02:29:54 -0700 (PDT) Subject: Re: [PATCH v3 6/7] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver 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 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> From: Daniel Lezcano Message-ID: Date: Wed, 11 Apr 2018 11:29:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180411085130.GN7671@vireshk-i7> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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