Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4506783rwe; Tue, 30 Aug 2022 11:18:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR524k1uN2F94u+OGmeCJa9+JHTDrOpW1oPFJ4iplmy0nXcRauG6UUr4baYp0Xi9OntEZ1TY X-Received: by 2002:a65:46cf:0:b0:41d:234f:53de with SMTP id n15-20020a6546cf000000b0041d234f53demr18946250pgr.457.1661883512266; Tue, 30 Aug 2022 11:18:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661883512; cv=none; d=google.com; s=arc-20160816; b=lIkCOQFu80nBuo/x+ghYN7KK5m4xAOrTgObOVviq6NkTf3Pa7ENSF7Nsjf4XPLTIwA XKje04wADQONRCPrytKc1TOnu/BLX4eXR4UR7kwkPKDHgPZFVSQXnGS+kscupEBlju4q FYjTqWrnZjIU9cxhc+fcONlHrRZxfYqJ8BvYv/kvMR6xYuHZ2cVyJn9M+lexwJnKJq2X N2JKK2yQvmhQuBUdEWnHjOppyJok2m8guh23GH1o2JZodNdOxV7RPm7v+MJY1NbjgOHJ RfQqZy3RAMizk+xZX0JXEcI306cO8vXgUICpfDOgcl3fjxemIe8doWg7XV3Yi5IpfTa0 2xNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=G27R74gpUJybFDRgsKSJ9c6PKNuI6cK7IYRLfnYD5j8=; b=J921mRJlrmLh9xBxbjjNa7Detz19ZH0lXGvS7AploSBclnH/OdfoTx0n9Eg1XA7ReP 6yGO2oDT9Jc8fTx77vMlP0dFra1DQblo04LnQckcvr+pWTuLLeLtYZMuSqfbF7UMQ8Qf FiRz+PAeiQiUD9BCUGpTYyzUAkzK2z1ZrIfm824oiiCkUR1NMENnGQPWDCQhOygBw1Ut b0CMZQ4I0EEFiCGkOJmDwxf9IVTEQKYO9R9IbStBf1JjwrnoVEPBv7BPTKnJs3p4QRqN ESC+BHCn9WFKyyTjtKz3XMTL6X8HW4bmTPFVDQfclDoGQ8eI4Iknnu0YZkPIlG6r62q5 gbIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aRwWmk36; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a170902e80900b00174665bbc29si11268396plg.161.2022.08.30.11.18.18; Tue, 30 Aug 2022 11:18:32 -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=@kernel.org header.s=k20201202 header.b=aRwWmk36; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230511AbiH3RWs (ORCPT + 99 others); Tue, 30 Aug 2022 13:22:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231349AbiH3RWG (ORCPT ); Tue, 30 Aug 2022 13:22:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57344AB063; Tue, 30 Aug 2022 10:20:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B24E8B81C35; Tue, 30 Aug 2022 17:20:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A02AC43470; Tue, 30 Aug 2022 17:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661880031; bh=NyZYEkqcXaZfqxjTZ50hQOYGRdfmSqXY3CvuyG/rMX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aRwWmk36+nDBTGPLgqNMuqs3zJMzbscxvy9TxkBp/Otc3dqcswl7gyd/llXRaeB/E uU38qC9tKKMPUAxQ/LsxhYQvpIz1mUYk+R1afkmx6s4EfHExexRXJIcchNcRtdWmwx Jycczwt0bO8SV/KLXtxRClPs7ajAPRGL3EYcwsMSL7pcHIzJgO0apT3eKKhrEvtDrc +YxFkzCwW+GTsxCn099NXovpxl2ULDCBNWsw688TxOGnNRNObejMD2szHp5qwtbOfN N+p96RiLVab9wOUA7X9tYpIXNPn+iDjOjShKVDO6S+tz/Ondw8COqcubNh/EvJ3mB3 RSSXgR5Ry33iQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Lukasz Luba , Viresh Kumar , "Rafael J . Wysocki" , Sasha Levin , rafael@kernel.org, linux-pm@vger.kernel.org Subject: [PATCH AUTOSEL 5.19 23/33] cpufreq: check only freq_table in __resolve_freq() Date: Tue, 30 Aug 2022 13:18:14 -0400 Message-Id: <20220830171825.580603-23-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220830171825.580603-1-sashal@kernel.org> References: <20220830171825.580603-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Lukasz Luba [ Upstream commit 6ca7076fbfaeccce173aeab832d76b9e49e1034b ] There is no need to check if the cpufreq driver implements callback cpufreq_driver::target_index. The logic in the __resolve_freq uses the frequency table available in the policy. It doesn't matter if the driver provides 'target_index' or 'target' callback. It just has to populate the 'policy->freq_table'. Thus, check only frequency table during the frequency resolving call. Acked-by: Viresh Kumar Signed-off-by: Lukasz Luba Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/cpufreq/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 2cad427741647..f9fd1b6c15d42 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -532,7 +532,7 @@ static unsigned int __resolve_freq(struct cpufreq_policy *policy, target_freq = clamp_val(target_freq, policy->min, policy->max); - if (!cpufreq_driver->target_index) + if (!policy->freq_table) return target_freq; idx = cpufreq_frequency_table_target(policy, target_freq, relation); -- 2.35.1