Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp223866pxu; Tue, 6 Oct 2020 05:05:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBYyRS9t/qXpB2bo3Jy3vBJLcjK549j2BU7QaJIi768Kuss1bVOUgtTGfz8blJUbgGg6iw X-Received: by 2002:a17:906:4bc4:: with SMTP id x4mr5021380ejv.240.1601985935421; Tue, 06 Oct 2020 05:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601985935; cv=none; d=google.com; s=arc-20160816; b=Un6Ad8GCE4+dTe+PDa0WjAvs/j/j5QO3Cehvnbi/Y6kgZIm1FPu2NIzvGBeG6Q4o20 IsqPiziXUEGhMf5uWFs8rXZX+PstlxfUISSuYcqw1t2QwVyRfBFfjboMU6M+69jx+Oak M1xiLKbd7EG/NN0UIkctDNO164Kq5cxHgKLVOlSHLHOovPMLNOwCLK5a1U51xkHSB2bd fL43ymVtUpTrJniW3nEBhwow/bWEhrZQwBrNs6eExkUrik/Qq2qLlM2Qx+O+a3akJe8s G8g5OlCG+gsU5TadZhDv5eKtn9s7B9kFTYELvC0cnhmFSa9HWgd1gyFWZZnuFZpK9Kqp LYAw== 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 :message-id:date:subject:cc:to:from; bh=xsWoNJMmqSPa0y9WftFgI/h7l7F5AOMH+0v+In0LfWc=; b=L6R7nVXGliN0/vqaI8jVZ9b6GIW801XJCGJXcwgX51qm5TTXKnevFcp3yLKLToFEHG 3/BJra6FebWnpe1U99ccnwHecMQn495AHh3ulw4jUfEti9NAQVV1R5MCHqEYc3b8LRWQ W4tKekEVfLwggH2CyWIRKVHERgTK9YRtBfK13o6daWJQZV+itY/hvWMbHaO7GA0ALfIi Q30nv977VZ4BjlXDK+//endhl/LTuBli3SCtN453ZBbSvMp/W1bN+yTW1APNBD9HqC4s bB9X0RvZOHgGLb480EX8xerjbPDZ7xw4s9jadOop7iogXXrFptCyKdi+CGO3yxg3hZG5 jHug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si1804127ejd.256.2020.10.06.05.05.10; Tue, 06 Oct 2020 05:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726197AbgJFMBe (ORCPT + 99 others); Tue, 6 Oct 2020 08:01:34 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:47766 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbgJFMBe (ORCPT ); Tue, 6 Oct 2020 08:01:34 -0400 Received: from 89-64-87-80.dynamic.chello.pl (89.64.87.80) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.489) id 1d3ccde0236c9eb8; Tue, 6 Oct 2020 14:01:32 +0200 From: "Rafael J. Wysocki" To: Viresh Kumar Cc: Linux PM , Peter Zijlstra , LKML Subject: [PATCH] cpufreq: schedutil: Simplify sugov_fast_switch() Date: Tue, 06 Oct 2020 14:01:31 +0200 Message-ID: <1869109.WhRmcVd4D2@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Drop a redundant local variable definition from sugov_fast_switch() and rearrange the code in there to avoid the redundant logical negation. Signed-off-by: Rafael J. Wysocki --- The code reads a bit easier after this change IMV. linux-next material. --- kernel/sched/cpufreq_schedutil.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) Index: linux-pm/kernel/sched/cpufreq_schedutil.c =================================================================== --- linux-pm.orig/kernel/sched/cpufreq_schedutil.c +++ linux-pm/kernel/sched/cpufreq_schedutil.c @@ -114,12 +114,8 @@ static bool sugov_update_next_freq(struc static void sugov_fast_switch(struct sugov_policy *sg_policy, u64 time, unsigned int next_freq) { - struct cpufreq_policy *policy = sg_policy->policy; - - if (!sugov_update_next_freq(sg_policy, time, next_freq)) - return; - - cpufreq_driver_fast_switch(policy, next_freq); + if (sugov_update_next_freq(sg_policy, time, next_freq)) + cpufreq_driver_fast_switch(sg_policy->policy, next_freq); } static void sugov_deferred_update(struct sugov_policy *sg_policy, u64 time,