From patchwork Fri Aug 16 15:09:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13766486 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 91F4DC531DC for ; Fri, 16 Aug 2024 15:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=q0sK0ufc7qEbd/mn2fdq4hcobz3MRQ2PN+HK1BuFHRw=; b=EKC7Bbe0pxtlzpg8gY/vPsxGff uTtJwsu4XteQl9fBFb69Qui4dAMszyaAjh4LNrJYNGV7OWPH5wlcWa/hXrO9pmjawmS+F1bHi29ul T6B8kJrnHmqyuZLQelM6iyPaP/EMDVWDacXIabAVKzXRjqMYe7RqKomOe5qQ5i/5Asv/GhupwJQdS VZXn0WJfpEInOTWtqfdcO60yHTMDCFz4nlurEv8iFLiJJP4CnWYwQfWup8iZDu2zBYvNuaG4iM4oT P9qQJE2jDhOiQYmPuI5YZeqzLR3l/doQPM/ZXahzTUrEUALs7qhMKbjx9fuKb+ZvvuCx+hohKEJYk UyjIyqXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1seyb7-0000000DKMj-0Yvx; Fri, 16 Aug 2024 15:10:37 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1seya8-0000000DK5c-3XYV for linux-arm-kernel@lists.infradead.org; Fri, 16 Aug 2024 15:09:38 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4280ca0791bso15486115e9.1 for ; Fri, 16 Aug 2024 08:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723820975; x=1724425775; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=q0sK0ufc7qEbd/mn2fdq4hcobz3MRQ2PN+HK1BuFHRw=; b=HwgTQNFTjjprQHEdW+d7wIFDTOP2IkgXFE6kvf5rk2JAbPulL9GaS858kmmfFS6k1A 0/C5sGC2wujv3H9qVpta5SrymbDckXXmQ0FVxMparxad1DgsdIyasJGmvLZlH4wFzzzV 9AYyy9bCELWmZvB7uAH3Cl02h0xuhc2tkwGIkKKBuBEBU459lbcCGcG6JEJqW1Iet5ne rjl0KoTk26FdqZU+JegTP/P7Nzmu2PlZbVAR5mymjirMVwxL1LYmfQj0FdghPuS7SjaT dBotEQIh0e1wnufmrXbAVtH0RPvBvdj+PSfiNQVgbSeuQkeHnroY6aoGedNHFHY6ukpA yLzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723820975; x=1724425775; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=q0sK0ufc7qEbd/mn2fdq4hcobz3MRQ2PN+HK1BuFHRw=; b=bI4urdGgL4Z7b3CoscQPuUmO1KJrNfsnLVCXXrL7Djuq7o6XScwdNPbbrwVKaWUYSa ug6iK7UgAJ+A/3l0LaglTcVmqjjpmRHcKZTh2w1Tc8dgqfiGwdFbIuuMApURQ7fDZaws MGclVsbCosXv/X/2oHuKp7p5MyQlxmbj0WbTDyAL8ObuWV8Lr60VKG0MAEDH3sI0/G8E E2cKJpiqrXbZyvS3JxMQVQD/6h4mEvXA0LK2TsaC9EHovdIg3YoJMQiiAEQgWnFCetBH fP8K16Bj1Ys1T3A89M/wWI6xZUCybo4X1EynMXS6D1yL+j74M3r8ssqvQGY4avkjZX1D ju+g== X-Forwarded-Encrypted: i=1; AJvYcCXSO5qAeshejP8khmADyYcQlR2Ap4k9RdvCsaAvDmJTNNkq0V79dakWTzj4DGsi9Z7UIvoZoWfqb6Uyx5QUFei4mV29uYf/qham6F3RO/Nb0pBcieM= X-Gm-Message-State: AOJu0YwVhBNi+XrzR3+ZyezgCaHctlDyfV+VMXoqjrJ4xipT9YFUj0wj gJCG2AT/5OxaHJdYkprmQ58iFQDosxtK00HDAsAMXSHU6Lj+4SJYSVs9lxaMG1o= X-Google-Smtp-Source: AGHT+IFhP/NIsW9PWfnEcWLqi7chpg87KWhwfD8tKVYrnOj6sJddsAiBh6dq11WCBuqo717hp+HeUw== X-Received: by 2002:a05:600c:444b:b0:426:6320:7ddf with SMTP id 5b1f17b1804b1-429ed7f944bmr19485875e9.35.1723820975298; Fri, 16 Aug 2024 08:09:35 -0700 (PDT) Received: from krzk-bin.. ([178.197.215.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3718984993fsm3808758f8f.31.2024.08.16.08.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 08:09:34 -0700 (PDT) From: Krzysztof Kozlowski To: Ulf Hansson , "Rafael J. Wysocki" , Daniel Lezcano , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/4] cpuidle: psci: Simplify with scoped for each OF child loop Date: Fri, 16 Aug 2024 17:09:28 +0200 Message-ID: <20240816150931.142208-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240816_080936_903762_DDDD1B48 X-CRM114-Status: GOOD ( 14.18 ) 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 Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jonathan Cameron --- drivers/cpuidle/cpuidle-psci-domain.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c index ea28b73ef3fb..146f97068022 100644 --- a/drivers/cpuidle/cpuidle-psci-domain.c +++ b/drivers/cpuidle/cpuidle-psci-domain.c @@ -142,7 +142,6 @@ static const struct of_device_id psci_of_match[] = { static int psci_cpuidle_domain_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - struct device_node *node; bool use_osi = psci_has_osi_support(); int ret = 0, pd_count = 0; @@ -153,15 +152,13 @@ static int psci_cpuidle_domain_probe(struct platform_device *pdev) * Parse child nodes for the "#power-domain-cells" property and * initialize a genpd/genpd-of-provider pair when it's found. */ - for_each_child_of_node(np, node) { + for_each_child_of_node_scoped(np, node) { if (!of_property_present(node, "#power-domain-cells")) continue; ret = psci_pd_init(node, use_osi); - if (ret) { - of_node_put(node); + if (ret) goto exit; - } pd_count++; }