From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58717C43219 for ; Wed, 1 May 2019 10:23:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3387F21670 for ; Wed, 1 May 2019 10:23:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726101AbfEAKXw (ORCPT ); Wed, 1 May 2019 06:23:52 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:61309 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbfEAKXw (ORCPT ); Wed, 1 May 2019 06:23:52 -0400 Received: from 79.184.254.69.ipv4.supernova.orange.pl (79.184.254.69) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.213) id 71690d2d1aeaf7d2; Wed, 1 May 2019 12:23:51 +0200 From: "Rafael J. Wysocki" To: Yue Hu Cc: viresh.kumar@linaro.org, rafael.j.wysocki@intel.com, linux-pm@vger.kernel.org, huyue2@yulong.com Subject: Re: [PATCH] cpufreq: Remove needless bios_limit check in show_bios_limit() Date: Wed, 01 May 2019 12:23:50 +0200 Message-ID: <21353710.QnO7stapYA@kreacher> In-Reply-To: <20190416024027.6516-1-zbestahu@gmail.com> References: <20190416024027.6516-1-zbestahu@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Tuesday, April 16, 2019 4:40:27 AM CEST Yue Hu wrote: > From: Yue Hu > > Initially, bios_limit attribute will be created if driver->bios_limit > is set in cpufreq_add_dev_interface(). So remove the redundant check > for latter show operation. > > Signed-off-by: Yue Hu > --- > drivers/cpufreq/cpufreq.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index d9123de..047662b 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -857,11 +857,9 @@ static ssize_t show_bios_limit(struct cpufreq_policy *policy, char *buf) > { > unsigned int limit; > int ret; > - if (cpufreq_driver->bios_limit) { > - ret = cpufreq_driver->bios_limit(policy->cpu, &limit); > - if (!ret) > - return sprintf(buf, "%u\n", limit); > - } > + ret = cpufreq_driver->bios_limit(policy->cpu, &limit); > + if (!ret) > + return sprintf(buf, "%u\n", limit); > return sprintf(buf, "%u\n", policy->cpuinfo.max_freq); > } > > Applied, thanks!