From patchwork Fri Oct 21 15:10:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13014903 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E238FC4332F for ; Fri, 21 Oct 2022 15:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=owqzWD6ql+AdFpAQVJOmyADDoXT8b9K+55pldn3w8fE=; b=oGJUa2JmIR2P0L BV7w2Nr0lXzg0k3WFCtLUI+KxQISa17UprlBvPJ964ixAuUv8fzJgP9A0huuloNMLeRv9Que3r/kw ZL2d2iKRUR1nN8oNXkWLtvwzirutBUVA8PkEQAy+g2tPFI0XPpFRN5KVUUiJ/r4vj4+ARmYQKmRvj 1M4mtBMW+LuhrUd+OIByu2yuPs7fuDsuX9rPdnWx9bYbFhe3DwIQYRHKMLdMKgeQWa5ND+TKEhKBA KJQHZLRmEgRZOOfHBmId6cp9wpukqrfYnSYnWYO0rorTMFkPQ0oU0XGrAJ6tZ/nTbHP2+9T7WQwSh E4ZF+no+JvXwPZ/lQsPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oltfU-008dqm-Ui; Fri, 21 Oct 2022 15:10:41 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oltfS-008dpP-2f for linux-arm-kernel@lists.infradead.org; Fri, 21 Oct 2022 15:10:39 +0000 Received: by mail-lf1-x131.google.com with SMTP id g7so5632946lfv.5 for ; Fri, 21 Oct 2022 08:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iOR9Cn2Ao7LcbAtkV7YNTyZf2Awy47Ush30fTe6NZ7o=; b=fumjPWjQIGVgJu1cVeqC9EpaFn0B5jT9PyBcxd6bHUvIZ5/THEeiHLj/jXOXYN6JM/ 3YcHnUceJdvMZzIhZYMTCxarOoMoIswIH5yLpCX/+rRe6iUDsh97NZdGXHSTvF0T76xG YDicGmnc9uT9Msc3k+OCraODleHuYdSm08c/m60SrutHpHJKyjlrg/poU6RkX6loVxr2 3NMCxhewOWuxeGGwll7RDSSeNkYNiyA6nxXTTfE93IO3RGp7+pWGt6oo9r8NszbWsvwR gbUTowFMGUWQV43bbGGFT8c9D5yp5JrXob++0d0DDRyR3uvez6EHKvSedO/IGlpuXPEZ eBaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iOR9Cn2Ao7LcbAtkV7YNTyZf2Awy47Ush30fTe6NZ7o=; b=wa2uwsFAGqMQ24FioN9A/rOjXLr4hngbjoRFHHoTMX3q5ZMulwoFii2SRTpTqrArK+ Ud5/g0ak1v+I7mS9yN/HHXzM6UfBbuct6+lRr6rzQPfQk54Hw/xOAxGwseNFGQHXDsyY AVLoS0syMxsJcoxUwXsHV4hIF/Z+S+tsB9QRAnNKyjtQ/GyW5BAgrnRSlQfh+6zB6p0d /wWomfzBRxFByQGJjxYQNh+R3enSvITxaxqfoRpVO+FuE1W7lsDu4gZo/67QirBzbRuG fASNieQ0sSk1C8r7UYiOkPWgNpHMp88ERAU9q227yyKeKwqqDGHrDzcQR/ZfXV+wi3gR CAWQ== X-Gm-Message-State: ACrzQf3XACv6E0G8QF269itqawCxeMcHCD1k0yRK8vEcgky12o0y48JL Oy0etxD4gn5V0RhPomk5v0FL4w== X-Google-Smtp-Source: AMsMyM4iURBeXV/sf9FyHh5MsVjFysPtxLXdAshK9S6YJaXUzdBzXiA9OI5BUaRS4gWE+zs8LR9GTQ== X-Received: by 2002:a05:6512:3a82:b0:4a4:7fc1:35b2 with SMTP id q2-20020a0565123a8200b004a47fc135b2mr6740050lfu.369.1666365034343; Fri, 21 Oct 2022 08:10:34 -0700 (PDT) Received: from uffe-XPS13.. (h-94-254-63-18.NA.cust.bahnhof.se. [94.254.63.18]) by smtp.gmail.com with ESMTPSA id s10-20020a056512202a00b0049476667228sm3199764lfs.65.2022.10.21.08.10.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 08:10:33 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Daniel Lezcano , linux-pm@vger.kernel.org Cc: Sudeep Holla , Lorenzo Pieralisi , Catalin Marinas , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] cpuidle: dt: Clarify a comment and simplify code in dt_init_idle_driver() Date: Fri, 21 Oct 2022 17:10:13 +0200 Message-Id: <20221021151013.148457-2-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221021151013.148457-1-ulf.hansson@linaro.org> References: <20221021151013.148457-1-ulf.hansson@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221021_081038_141978_34CC4CAA X-CRM114-Status: GOOD ( 13.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The drv->state_count is assigned the total number of available states, so let's make that clear. Signed-off-by: Ulf Hansson Reviewed-by: Sudeep Holla --- drivers/cpuidle/dt_idle_states.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c index 448bc796b0b4..7ca3d7d9b5ea 100644 --- a/drivers/cpuidle/dt_idle_states.c +++ b/drivers/cpuidle/dt_idle_states.c @@ -211,12 +211,9 @@ int dt_init_idle_driver(struct cpuidle_driver *drv, of_node_put(cpu_node); if (err) return err; - /* - * Update the driver state count only if some valid DT idle states - * were detected - */ - if (i) - drv->state_count = state_idx; + + /* Set the number of total supported idle states. */ + drv->state_count = state_idx; /* * Return the number of present and valid DT idle states, which can