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: 6742 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp753178wrr; Fri, 21 Oct 2022 08:15:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6bJ0ncpfOGvSUIiNgSg0y0hXOKJKZoPTsZVouM2lpboSnjTm49IgGyTRLOwGrZIhjhXJp/ X-Received: by 2002:a62:d448:0:b0:565:ef61:ee0d with SMTP id u8-20020a62d448000000b00565ef61ee0dmr19658113pfl.73.1666365302893; Fri, 21 Oct 2022 08:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666365302; cv=none; d=google.com; s=arc-20160816; b=Ws+XTGX63VhzPILrcYh4R4bRSmuKfecTEmnIhXikBmNKc3Z+4SDDm9uWCC2NN4W8fH BjNnkNq+iyptnC5r8GjAYb4lChbVwoDUrT0HvDJZqLzesEoY9LVijVPskUx5PwM9l73t Up4cKtsbAgbnoiLrJyDCaByYpfx2Rdk7lz5mu5zy1KgZOslRN2JltFOhbjkactJdA0NO CsHx/bzBY8rPSCz+hsp6FXyGUrcZHWNY89i2nw/xaK2H143dGA9vXgACQxlqFb1V1EYd DrSKgoVxGgw9b4DsZ4kZEKU09CbgMmAJh36FY5ssp4GwfPs3As+ran4YIl2zrwVYqohi oIXw== 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 :dkim-signature; bh=iOR9Cn2Ao7LcbAtkV7YNTyZf2Awy47Ush30fTe6NZ7o=; b=zjNfxbfHBxDB1tFMpAclAPgSMhiVR0biMNYfkB1MvWxKpky+cn9ATUDrCyQSc1ZGNP C+cj/6JOwaSI9mHLJ1j54VAWYg5wWuN/FMEkqDSM1ZJzD8UTMP30tZdh+uaf8NCuJGGI QzXuwk/avlvuNxRaJHcZaasW3w3XGW3rUOvyTYQ8RakxVNO6HJYw7VuZkHP8U6w2G194 63Q5prKGFEKMvHLG+sjXKH1DvpLfLnigllE/RbZ9cxOR+58sripDLC8R+EE8Yc+iAOze noeROcxlkvEcTAdN2hKqOOYsUUXZ+Rivqikb25WzfrQR6+jZTRDC9C3elg2IKiffV07p ELHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fumjPWjQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s73-20020a632c4c000000b00434f938b9efsi25121716pgs.4.2022.10.21.08.14.49; Fri, 21 Oct 2022 08:15:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fumjPWjQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229491AbiJUPLZ (ORCPT + 99 others); Fri, 21 Oct 2022 11:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230388AbiJUPKh (ORCPT ); Fri, 21 Oct 2022 11:10:37 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF83F1669A9 for ; Fri, 21 Oct 2022 08:10:35 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id r14so5687183lfm.2 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=A2peLmn1cXF2JpjusRCNNWN/xucLqzsICEAgl7yLVrqERJhrq4zGvYY3OQJ8bwR3/B WLsEVNKpweqYw0zIhszIsJT2D0sLs1X0WGuqqRVg6bVJSI8t1Af2CilSETq4tIOjO6/h K1deZDdL4C+UaxBehO+BJtPByDTCFtFoKhb7z+eI4jWehbBZKqEuvjs4hMAfaxKdFZJM 9Bp/dEVbGJtOxrm5GlkvRvxfE3tp7UxuhgTDHRW1neY/8TbmBcQbhYwkXRQC6Y6QjVZW eb5MYzHVtwBrlPNRGcvXLiGz64Cve1r58PtfuxYe8+bgIF9YQ9tBOYNtEJJM/FIx7Yp8 jAPQ== X-Gm-Message-State: ACrzQf17p9elAdxKao0/tPhHfZWt7MhkDeR/RDuLQu5vWOQQF5PwUg4u yEAhA8mNstK3rfneXi7s4w/bSQ== 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747310663753900857?= X-GMAIL-MSGID: =?utf-8?q?1747310663753900857?= 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