Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2791522rda; Wed, 25 Oct 2023 12:22:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+YtlhEBo4oVjehi91hZh99k46VwBHCQa+VXbUjWUn1K/HUG+un8diKt6Ty3+Fsi3LaeJH X-Received: by 2002:a25:4641:0:b0:d81:754a:7cb8 with SMTP id t62-20020a254641000000b00d81754a7cb8mr13603020yba.65.1698261731042; Wed, 25 Oct 2023 12:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698261731; cv=none; d=google.com; s=arc-20160816; b=cpS7s4D6fvN5ATyGfjxIvCKN28uXf9gXl+j/Ymxzw7jvBSuFFA8Ysk8zwAcXHDrAIf /40a5SO4vot55t1mUNtc26bSNRGlgR7NOHO59RtqKxmR3NU/x5SZoodRWyd8sv4mXJJF zFyZG8TH5eaVN9GwqfSoF3s1fSlCoa11nDPGmtBzEkK0Tq7QXf7RIkFvwi+JcVVijszR kVpa66idPRzOw2hXo3SbXcki+oLCltRECVuhXP6rGU1YHQizKaZEta2zAXJG2fzlj/xM LDPiK3TJwXsT1KnDbd3b0XdLSjE2y+8+bFCPthQF+5RYfoDebdCykGULmD9Ja78UZNKT AhCQ== 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; bh=n7wJu54+9OgXfOEWE22LP1UdpKkjCQk7XN5U9KApMBc=; fh=8IgpUQ2T6XGOjA/qDosxdUSIIBz0a6nQ23NA8pgv1Tg=; b=hpTqzEXq7A4rj7MnjGgKmtTVmT0yXRiGoE87b4TGQh2YhJSN+LspIapm9GDng7G6s4 eq7PrvlfkPBaEwBxdIgOhJRIn8djtLtWcpeNg/T8G33zRDhWIhnqIaICm87YZGeF891j 1CIPxGl+BVCuaXk9JWFEUBiqRHAhHwtNNaOsQzY95yc0k0yt4FZawWESx5otp2zolNPq djIm1rcBkneg0vl9rQS8Wybnbh3IimQce68ts286h2rhKB1m7AEu9AQqHhD7013qrrb7 qhBFPof04Bv5x1ea971WqOVyvlF+62K66+sL5WoJpcLG2+/zgG3L7p0pGxZaUPx1PI00 MhKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id n21-20020a25da15000000b00d9caafe5160si4872904ybf.523.2023.10.25.12.22.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 12:22:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id AC3BD813CDA8; Wed, 25 Oct 2023 12:22:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232566AbjJYTV7 (ORCPT + 99 others); Wed, 25 Oct 2023 15:21:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231601AbjJYTVv (ORCPT ); Wed, 25 Oct 2023 15:21:51 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BE0E9183; Wed, 25 Oct 2023 12:21:49 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3B7962F4; Wed, 25 Oct 2023 12:22:31 -0700 (PDT) Received: from e129166.arm.com (unknown [10.57.81.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 663653F7C5; Wed, 25 Oct 2023 12:21:48 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org, daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-pm@vger.kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com Subject: [PATCH 6/7] thermal: gov_power_allocator: Remove unneeded local variables Date: Wed, 25 Oct 2023 20:22:24 +0100 Message-Id: <20231025192225.468228-7-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231025192225.468228-1-lukasz.luba@arm.com> References: <20231025192225.468228-1-lukasz.luba@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 12:22:09 -0700 (PDT) There is no need to keep some variables. We have a shorter name variables in the governor private structure 'trip_max'. Remove the local 'trip_max' and 'ret' variables from the allocate_power(). This change is not expected to alter the general functionality. Signed-off-by: Lukasz Luba --- drivers/thermal/gov_power_allocator.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c index 0f7f8278eacc5..e6d2f0fe8d2fd 100644 --- a/drivers/thermal/gov_power_allocator.c +++ b/drivers/thermal/gov_power_allocator.c @@ -379,17 +379,16 @@ static int allocate_power(struct thermal_zone_device *tz, int control_temp) u32 total_req_power, max_allocatable_power, total_weighted_req_power; u32 *req_power, *max_power, *granted_power, *extra_actor_power; struct power_allocator_params *params = tz->governor_data; - const struct thermal_trip *trip_max = params->trip_max; u32 total_granted_power, power_range; struct thermal_cooling_device *cdev; struct thermal_instance *instance; u32 *weighted_req_power; - int i, weight, ret = 0; int total_weight = 0; int num_actors = 0; + int i, weight; list_for_each_entry(instance, &tz->thermal_instances, tz_node) { - if ((instance->trip == trip_max) && + if ((instance->trip == params->trip_max) && cdev_is_power_actor(instance->cdev)) { num_actors++; total_weight += instance->weight; @@ -427,7 +426,7 @@ static int allocate_power(struct thermal_zone_device *tz, int control_temp) list_for_each_entry(instance, &tz->thermal_instances, tz_node) { cdev = instance->cdev; - if (instance->trip != trip_max) + if (instance->trip != params->trip_max) continue; if (!cdev_is_power_actor(cdev)) @@ -463,7 +462,7 @@ static int allocate_power(struct thermal_zone_device *tz, int control_temp) total_granted_power = 0; i = 0; list_for_each_entry(instance, &tz->thermal_instances, tz_node) { - if (instance->trip != trip_max) + if (instance->trip != params->trip_max) continue; if (!cdev_is_power_actor(instance->cdev)) @@ -484,7 +483,7 @@ static int allocate_power(struct thermal_zone_device *tz, int control_temp) kfree(req_power); - return ret; + return 0; } /** -- 2.25.1