Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp268565rwi; Sun, 9 Oct 2022 23:14:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5IAbDUDGBbKAUqtqSKmA9hufVi30qswoM2nZh4lfu35Wv2vX32uBtcMcXaK5cp1iAHzKkv X-Received: by 2002:a05:6402:d05:b0:425:b7ab:776e with SMTP id eb5-20020a0564020d0500b00425b7ab776emr17198380edb.142.1665382461287; Sun, 09 Oct 2022 23:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665382461; cv=none; d=google.com; s=arc-20160816; b=D6I/4ONcQbOaznOlzynkGRhwgyXsGZMLQTT5UQPS59xUSol8PDZAnhiZNkdbqb6FMM AMEH2yULhk2Gb1u8O/fL2iu9377uDj6IW68zSw+9mxh/mvwjkgm5IgFPabgBBHcsBXzH d8bGSRQOEYB3vsshyCldx+ZkYlILI5NVqTD5qLVd4Kc324TLMIXrAJGQfTo2RWItqLf3 M1Fh1vJSvtMpApLO8QwRX3MhqQd5Ig/k9/nL946tl4pja8NmO4N4fxCXGyvDBwrcgIG4 z3uZchFhJuhDKvqjiutXPAauLIpQBxQ7YKmzl4X6A/7z/TG6PYr6T1UaaNNjf/jm/IHt 9Bdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pfQsfUWcWLp7hNK3mWIV/Z7JosDPzJlAzLay9IBS03w=; b=KhC/PalXG7S5M3SiiUMylU06GYC5+ADxDriS/dUS5l3QQe2rW7uQqPz8/xi+0t+LIo YyvH88csm6lfZfIoCsDNxp/H+Fwa6fVhVzTOGo9Y862gQ690VWz41BdfMnzrov+QzmXh GB3mMWDRahTmPLy/1kBm98c1xLOiYHIxUeOTezsoBNrD1TjL7qZ2ItQ1qvARd1EDUqgA M8g7k9/ZQWLkzPTwFomo2S90OYGqzlo2hIx1RSpPHyApIfQtIUrG5kRwVjAL0QiqGSEV KSNXLj3qWIv3WpjXiIK2+agnRs36hhlHGYZPfJPQhrtHC380u3NbkkhJVuCyoNGZASPs MSSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J8KfV2yN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd20-20020a170907969400b0078db6b965c7si2290947ejc.782.2022.10.09.23.13.52; Sun, 09 Oct 2022 23:14:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J8KfV2yN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231396AbiJJFgw (ORCPT + 99 others); Mon, 10 Oct 2022 01:36:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231367AbiJJFgY (ORCPT ); Mon, 10 Oct 2022 01:36:24 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E654445F77 for ; Sun, 9 Oct 2022 22:36:17 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id g28so9872241pfk.8 for ; Sun, 09 Oct 2022 22:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pfQsfUWcWLp7hNK3mWIV/Z7JosDPzJlAzLay9IBS03w=; b=J8KfV2yNmkok12hzdB2FjY3ZgF+GPihES0oERJK0ZcgUeXtDu4loss1VPhphzgQKPw c6yUZGS34xey1Wo456Nv7HPnwmZ2W1Xee+y2cNqIDIOMcyevdW3QbJd6joJXgZnv09T0 JugIJHbEDrIbT7dI+RSkFrslacUZ5+QAu1CjCPHSw77HBoBIAAxgHphMVdxmdSr2qivV 7FFJfjBFxXG2XOboIQYoNf2C1RYPx6JHStXHrXHybwTAiJp0zb+Jea8687SyG+nfrbxW WtjkvPXJF1LRMVQe2dCB5VmFZYLWfDDv7BrBWZMauOJ7ruwGeoj8jrw4O9XVVaEu169I +0nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pfQsfUWcWLp7hNK3mWIV/Z7JosDPzJlAzLay9IBS03w=; b=AcFcCNVycXXsvK8bV4E1IM4YJSVAk7UqXb5qyk/lzHZPbcnwLxkXVcrjtrVzID8RFh 26kNsh5WgJVNT0N5ChwhDLjD3ZKGjPSNesYSdBLSg6x9H/cD4FS8CNtQuWHEn8hKcq+i sr/n+p5xtNhT7GywexwD0O/7Rl6j/qwNn17pzDh7aANRgX6wuD+Kcq8olFlNxAdSzzQx 8mv4UL/Ua85f/Fc4m7lIyEf5ACcRwjXBj51Y5mfTNfAivv0DTB0GJ3TuCriEWFMDL8Nc zCRioTs+q7QLdNBoKeezBVh9U6dklfOuRZJk5EmCmxFRYS52jkS7l+s47LNkuSXuhTpn 4hTQ== X-Gm-Message-State: ACrzQf2i28Xg/JFAwAzOvrC7I8X8Qp9nMDz4K6PC5U8jE3vYidQZOtSp yYK6CjW/DhulCsDnHa2x3rOC2P6UIwH8+A== X-Received: by 2002:a05:6a00:1ac8:b0:563:7d18:7a15 with SMTP id f8-20020a056a001ac800b005637d187a15mr998749pfv.59.1665380177243; Sun, 09 Oct 2022 22:36:17 -0700 (PDT) Received: from localhost ([122.172.86.128]) by smtp.gmail.com with ESMTPSA id b7-20020aa79507000000b005635477c42dsm1445741pfp.133.2022.10.09.22.36.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Oct 2022 22:36:16 -0700 (PDT) Date: Mon, 10 Oct 2022 11:06:14 +0530 From: Viresh Kumar To: Lukasz Luba Cc: linux-kernel@vger.kernel.org, rafael@kernel.org, linux-pm@vger.kernel.org, Dietmar.Eggemann@arm.com Subject: Re: [PATCH 1/2] cpufreq: Change macro for store scaling min/max frequency Message-ID: <20221010053614.zu2f3btjlh7woxbj@vireshk-i7> References: <20220930094821.31665-1-lukasz.luba@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220930094821.31665-1-lukasz.luba@arm.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30-09-22, 10:48, Lukasz Luba wrote: > In order to prepare extension to the store_scaling_max_freq() remove > the macro and use two normal functions. The set value for max frequency > is important for the task scheduler. > > Signed-off-by: Lukasz Luba > --- > drivers/cpufreq/cpufreq.c | 47 ++++++++++++++++++++++----------------- > 1 file changed, 27 insertions(+), 20 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 69b3d61852ac..1f8b93f42c76 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -715,26 +715,33 @@ static ssize_t show_scaling_cur_freq(struct cpufreq_policy *policy, char *buf) > return ret; > } > > -/* > - * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access > - */ > -#define store_one(file_name, object) \ > -static ssize_t store_##file_name \ > -(struct cpufreq_policy *policy, const char *buf, size_t count) \ > -{ \ > - unsigned long val; \ > - int ret; \ > - \ > - ret = sscanf(buf, "%lu", &val); \ > - if (ret != 1) \ > - return -EINVAL; \ > - \ > - ret = freq_qos_update_request(policy->object##_freq_req, val);\ > - return ret >= 0 ? count : ret; \ > -} > - > -store_one(scaling_min_freq, min); > -store_one(scaling_max_freq, max); > +static ssize_t store_scaling_max_freq > +(struct cpufreq_policy *policy, const char *buf, size_t count) I thought we can't break right after function's name according to kernel's coding guidelines. Did you run checkpatch on this ? > +{ > + unsigned long val; > + int ret; > + > + ret = sscanf(buf, "%lu", &val); > + if (ret != 1) > + return -EINVAL; > + > + ret = freq_qos_update_request(policy->max_freq_req, val); > + return ret >= 0 ? count : ret; > +} > + > +static ssize_t store_scaling_min_freq > +(struct cpufreq_policy *policy, const char *buf, size_t count) > +{ > + unsigned long val; > + int ret; > + > + ret = sscanf(buf, "%lu", &val); > + if (ret != 1) > + return -EINVAL; > + > + ret = freq_qos_update_request(policy->min_freq_req, val); > + return ret >= 0 ? count : ret; > +} > > /* > * show_cpuinfo_cur_freq - current CPU frequency as detected by hardware > -- > 2.17.1 -- viresh