Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp786271pxj; Wed, 2 Jun 2021 11:21:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza92yfL4QwyjKh3gd4Ea3PA7KBX1CDx3XXX77ykteqXb6s9wrL9jfroXwI/VtOcgESqSce X-Received: by 2002:a17:906:318b:: with SMTP id 11mr34746581ejy.395.1622658095220; Wed, 02 Jun 2021 11:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622658095; cv=none; d=google.com; s=arc-20160816; b=B43Bx9feuaUB2P7kwDZSQ6LblxEdTXgM6FXlnJbrs3j/ehQX/mGfLrIHK3zF0zdPmJ LXuqqdqORf2YeA5zodPjIJsOK1x9DQZGi7YPzxD4TIDiEFOWZpddS17eoR2DCjqUeOXU WDUG4GNAD0NOHb5nkhsuh+1OZByKL9kEP2PbL9OUQnxA0iVh8rL5be/psz27f1CMCXXl Gwe6EpqbLyAH2Wz3dgtsS2oRO5YuteekCGEMzrN+X7SXPxWdtG98glpEyWIWMAyQwPIr 8YNUCfUpRsNOe84Ba+g3A+sdh86cl1HBbsWUVGpbqjFpb8g/lyAYHw4OnB5jeKejCLtx pOsA== 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=n/rUMGA1J6+oVfShp3HpJTVya1mgz7I+K6M7oCNY3vc=; b=uliC9vqq2JYrAuPDmDbYOeno5cPb4LhNW95pM33BLIaQwdtWZVNu+r83/4k/TAmVOT dCUW8lRzax02PPBXClTZ1Ie8qcRI+eyk1q1o2j/K0G44uwlXh9S5XjJbgo9gahFV4m5V vkx4vR8XnZnM60Hl4Av3HjScYEYRUsOLmOzYe7ulqJkhZs8GIX59FWWhheXkgsIy7hFs gGdFrKxEg0soIeI/9tTQ/gV97/ZUPYqxvvF8Q5m5v/CsTz84RmAiiFCqTflDNN5wls3H 4atxZ/QPrY/afA3mDYXw4WbT4sW1HedDiUiaWnH9eyNI4oa462KjLaarKlMMFDaGrQ3I AFYA== 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 au24si487695ejc.482.2021.06.02.11.21.11; Wed, 02 Jun 2021 11:21: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 S229775AbhFBSUl (ORCPT + 99 others); Wed, 2 Jun 2021 14:20:41 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:58002 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbhFBSUi (ORCPT ); Wed, 2 Jun 2021 14:20:38 -0400 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 2.0.5) id ecbaeec465f7694a; Wed, 2 Jun 2021 20:18:53 +0200 Received: from kreacher.localnet (89-64-80-45.dynamic.chello.pl [89.64.80.45]) (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 v370.home.net.pl (Postfix) with ESMTPSA id 139DE6697FA; Wed, 2 Jun 2021 20:18:53 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PM Cc: LKML Subject: [PATCH v1 2/5] cpuidle: teo: Cosmetic modification of teo_select() Date: Wed, 02 Jun 2021 20:15:52 +0200 Message-ID: <3377367.iIbC2pHGDl@kreacher> In-Reply-To: <1867445.PYKUYFuaPT@kreacher> References: <1867445.PYKUYFuaPT@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 89.64.80.45 X-CLIENT-HOSTNAME: 89-64-80-45.dynamic.chello.pl X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrvdeljedguddvfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdejlefghfeiudektdelkeekvddugfeghffggeejgfeukeejleevgffgvdeluddtnecukfhppeekledrieegrdektddrgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepkeelrdeigedrkedtrdeghedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=2 Fuz1=2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Rafael J. Wysocki" Initialize local variables in teo_select() where they are declared. No functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/cpuidle/governors/teo.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) Index: linux-pm/drivers/cpuidle/governors/teo.c =================================================================== --- linux-pm.orig/drivers/cpuidle/governors/teo.c +++ linux-pm/drivers/cpuidle/governors/teo.c @@ -241,10 +241,15 @@ static int teo_select(struct cpuidle_dri { struct teo_cpu *cpu_data = per_cpu_ptr(&teo_cpus, dev->cpu); s64 latency_req = cpuidle_governor_latency_req(dev->cpu); - int max_early_idx, prev_max_early_idx, constraint_idx, idx0, idx, i; - unsigned int hits, misses, early_hits; + int constraint_idx = drv->state_count; + unsigned int hits = 0, misses = 0; + unsigned int early_hits = 0; + int prev_max_early_idx = -1; + int max_early_idx = -1; + int idx0 = -1, idx = -1; ktime_t delta_tick; s64 duration_ns; + int i; if (dev->last_state_idx >= 0) { teo_update(drv, dev); @@ -256,15 +261,6 @@ static int teo_select(struct cpuidle_dri duration_ns = tick_nohz_get_sleep_length(&delta_tick); cpu_data->sleep_length_ns = duration_ns; - hits = 0; - misses = 0; - early_hits = 0; - max_early_idx = -1; - prev_max_early_idx = -1; - constraint_idx = drv->state_count; - idx = -1; - idx0 = idx; - for (i = 0; i < drv->state_count; i++) { struct cpuidle_state *s = &drv->states[i];