From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E97DC3F2D1 for ; Wed, 4 Mar 2020 10:50:50 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D413420732 for ; Wed, 4 Mar 2020 10:50:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YKhobzjU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D413420732 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=REOV5PimvmKEJ/gATXD8KFNaW+ngjPqLzU1Yonv1i+E=; b=YKhobzjUlRlKRy PCMq8kqvhaqgxdeRiLf+HukPeddL2gGzZ4D4j0YGPaLdjCK0BX767PYHzixXQUHEKEHIhBu6mVeqe 1sWuMHPps8ERuJlPm1YhIIwjyAeCKtkNiPpTx2BfcQAmlsTCCsIJHt/yagGz+2JgRqXZTGwU2Guke ArnsJ9a1pH0/itO3rBKkmkcIe+b+NryWf04Bwc6tAG9YE0lfN+T/RTSibCKpel9J2ll1x4oohx027 tK/KsidAiuQPyZgjwJ1oL8so5IccdOpAFtb8ByX3OwT6BH5ZDwARxrhmAvdaMvgVNJsRycVWDYXqR bEzgTcVbXH9btr91yp0g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j9Rby-00039O-PC; Wed, 04 Mar 2020 10:50:46 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j9Rbv-00037K-Lf for linux-arm-kernel@lists.infradead.org; Wed, 04 Mar 2020 10:50:45 +0000 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 C0C0030E; Wed, 4 Mar 2020 02:50:42 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 553B13F534; Wed, 4 Mar 2020 02:50:41 -0800 (PST) Date: Wed, 4 Mar 2020 10:50:39 +0000 From: Sudeep Holla To: Ulf Hansson Subject: Re: [PATCH v2 2/4] cpuidle: psci: Fixup support for domain idle states being zero Message-ID: <20200304105039.GC25004@bogus> References: <20200303203559.23995-1-ulf.hansson@linaro.org> <20200303203559.23995-3-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200303203559.23995-3-ulf.hansson@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200304_025043_756069_2F90C785 X-CRM114-Status: GOOD ( 17.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Benjamin Gaignard , linux-pm@vger.kernel.org, Stephen Boyd , Daniel Lezcano , "Rafael J . Wysocki" , Lina Iyer , Bjorn Andersson , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 03, 2020 at 09:35:57PM +0100, Ulf Hansson wrote: > The current code intends to allow a PSCI PM domain to have none domain idle > states defined in DT. However, a few minor things needs to be fixed to make > this correctly supported, so let's do that. > > Reported-by: Benjamin Gaignard > Fixes: a65a397f2451 ("cpuidle: psci: Add support for PM domains by using genpd") > Signed-off-by: Ulf Hansson > --- > drivers/cpuidle/cpuidle-psci-domain.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c > index 423f03bbeb74..c34b12c4069a 100644 > --- a/drivers/cpuidle/cpuidle-psci-domain.c > +++ b/drivers/cpuidle/cpuidle-psci-domain.c > @@ -49,6 +49,9 @@ static int __init psci_pd_parse_state_nodes(struct genpd_power_state *states, > int i, ret; > u32 psci_state, *psci_state_buf; > > + if (!states) > + return 0; > + Was any issue found ? Or just code inspection ? If states = NULL, state_count = 0, and I don't see anything blowing up. It may save couple of extra instruction execution. > for (i = 0; i < state_count; i++) { > ret = psci_dt_parse_state_node(to_of_node(states[i].fwnode), > &psci_state); > @@ -96,6 +99,9 @@ static void psci_pd_free_states(struct genpd_power_state *states, > { > int i; > > + if (!states) > + return; > + Same here and kfree(NULL) is also valid. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel