Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp301130lqj; Wed, 10 Apr 2024 10:46:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWoSxra8XNFUKWx+6voq+AlDwJvxI6qHkxwyZ5HqgJIKPiRLCbLJpQuR30RwacgMpCVvcJwDcsgx8oquhgCIhSI5VsEGZEHlIdbwtiyNw== X-Google-Smtp-Source: AGHT+IG1ktdHnfLIBe27/HgahkpcJFU43ZE9neDNrmFIXEAz5oPZoixeRhTomMcDu7SnDwexwAmD X-Received: by 2002:aca:1a18:0:b0:3c6:29b:fe7a with SMTP id a24-20020aca1a18000000b003c6029bfe7amr3150299oia.18.1712771215151; Wed, 10 Apr 2024 10:46:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712771215; cv=pass; d=google.com; s=arc-20160816; b=xV6LlaBriQq0F33dI53GlNCRxF/cru2aMBRmnPH+OUlxXiPR0BRnp9dVFW5y3eeACz OeiNZEVx3F7LVEENLRbTsLO9F23ftjvoADCYwUG98mS3kBptjIclBffXNgHcVy2I/QJh v6FW+4UbPK/GAhh3yoxcLlds7ytE5KwqmjNQgp85YByAKtvALlrsGrmmO9AkcEXOgdBz xVAhDyCD9rcf026/jsZ0GC8KeUwHN/d+YCczUoD2jCNrN7tZITbdrPSGADtkjpfmwdtl jF+xfjEqQ1GJEmDa9R0Quaq4mCTddKHDCE9xfmzCej3GasnjRW8RnF0F2aozKUOfA8Uy BRow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XygUgexZXWnI3vqqhh6RqjXjSOKW2wyKyqyPxLjLSYQ=; fh=0I/rqIlL4373pOps8oaBYF1ECx5xbCzL9wLU5PgpMhU=; b=eAgoZfyatlN1o7WkXGkDDUT3ScyJi6LbIIB6P4ggCpQN7WpwhUtotK3yUdqIhMQrhi G6DGqiO7KVdFEmPEsaIuy/vxbvj9Ikwb8q+eR1qy2ir+4WGWZTcQ59Ei8eTCCXedCCFN 99h3k4zIoNdFxXzbOhqw0TvpPueWIxZE/x+PtGbm2kJ6+cuOZNoGupj8Cxi9Y5MPEste 9ceA81DLL53G39RBTlyguGscZHy8llM49l2+ao3sMcEVyUKvHU4z8Ore4qdybaJFf5ep HBLr8hWumnCT0uD9ailSfrdi1tqNWPGfNonM9psiYRgdlXFFPpieVcw2+9bb+XOUxObW mpkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b=UG3RqXFW; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-139125-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139125-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p14-20020a05622a13ce00b00434921c3167si7624885qtk.464.2024.04.10.10.46.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 10:46:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139125-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b=UG3RqXFW; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-139125-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139125-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C70A01C23105 for ; Wed, 10 Apr 2024 17:46:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C61431836C2; Wed, 10 Apr 2024 17:45:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b="UG3RqXFW" Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5BC417F375; Wed, 10 Apr 2024 17:44:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712771099; cv=none; b=QJN2Vmxwj4JsJMNnO8zT2LrjqqpwIT8STtNtSOLpGQ/BzHv+rJ9DGwp/dZkVFb/2k9MMcCxNEJkdL0zZB++uITCTHP1WrmeKKmuz2a1IfJ3np9RWNtBPNi3vvRvAlhhCIeo66dtrlEMOdhj6O8kSNhJO4gDWuewmhBH55PNpezs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712771099; c=relaxed/simple; bh=jZ42qBAOVfXfjDC/gxg6TKm2g0q8hkME0qL1SccI63w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aYMqPjvUfOpk3eEEKGCZuTjzYerF+ydnt61Xqzvimb3GVT1UrNrLsQIA63ZW/ag3FyePWp7/mWBsQmBHdbmg7c/tJgCFe2K1NQSJrt/5iwX7+TO1lNccuK4wwCoRnUdWymDqmP+xVDDU1CE65ilmAWPUAtg42jQWRnCpWx9Vbz4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; dkim=fail (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b=UG3RqXFW reason="signature verification failed"; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 6.0.0) id 2915b8068ed30433; Wed, 10 Apr 2024 19:44:55 +0200 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id 37C9C66C66F; Wed, 10 Apr 2024 19:44:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rjwysocki.net; s=dkim; t=1712771095; bh=jZ42qBAOVfXfjDC/gxg6TKm2g0q8hkME0qL1SccI63w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UG3RqXFWFOLKMOX4IoF4HNLP+dfdQ3sRfdSrc3uSmyDXCP+4JLt5RUtS8vDFcgWBG Oz0Y0+qCWK3W+jMJHeChNUL8uiMwvr/lxzbVFmf5jowd2EQhXHFc+bVILc/Szv7PDa w0c8tjyL4TyRR7kOs3oEAx8XD2HwwyzNuWq+/lTIBi2V2R5zrFpQuykzs1o3Wal2+T npZ6Iubb828hRYBbalL8unut4mSK3ZDPtUp99mWqNTG4O3IQzsPVA0nawSvpZUD0Zo Pgiy5vJSs7Tnp0RP3xtdo73VgfRziAuw7qFdYPcAeq/icdyiOaMc/HhaWGjBXnt+RQ MWGiSU74t7PRQ== From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Daniel Lezcano , Lukasz Luba , Srinivas Pandruvada Subject: [PATCH v1 07/16] thermal: gov_power_allocator: Eliminate a redundant variable Date: Wed, 10 Apr 2024 18:12:45 +0200 Message-ID: <1913649.CQOukoFCf9@kreacher> In-Reply-To: <13515747.uLZWGnKmhe@kreacher> References: <13515747.uLZWGnKmhe@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudehiedguddugecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeehpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehluhhkrghsiidrlhhusggrsegrrhhmrdgtohhmpdhrtghpthhtohepshhr ihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 From: Rafael J. Wysocki Notice that the passive field in struct thermal_zone_device is not used by the Power Allocator governor itself and so the ordering of its updates with respect to allow_maximum_power() or allocate_power() does not matter. Accordingly, make power_allocator_manage() update that field right before returning, which allows the current value of it to be passed directly to allow_maximum_power() without using the additional update variable that can be dropped. Signed-off-by: Rafael J. Wysocki --- drivers/thermal/gov_power_allocator.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) Index: linux-pm/drivers/thermal/gov_power_allocator.c =================================================================== --- linux-pm.orig/drivers/thermal/gov_power_allocator.c +++ linux-pm/drivers/thermal/gov_power_allocator.c @@ -747,21 +747,18 @@ static void power_allocator_manage(struc { struct power_allocator_params *params = tz->governor_data; const struct thermal_trip *trip = params->trip_switch_on; - bool update; lockdep_assert_held(&tz->lock); if (trip && tz->temperature < trip->temperature) { - update = tz->passive; - tz->passive = 0; reset_pid_controller(params); - allow_maximum_power(tz, update); + allow_maximum_power(tz, tz->passive); + tz->passive = 0; return; } - tz->passive = 1; - allocate_power(tz, params->trip_max->temperature); + tz->passive = 1; } static struct thermal_governor thermal_gov_power_allocator = {