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 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 C5785CF6491 for ; Sat, 28 Sep 2024 16:31:17 +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: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc: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=hkOMTEI9vAzPrXa+fTuuwOUeLvGRnipn6QDSPLut/OA=; b=1qbJinqhSXUJWgrBKpThQ8zbgD f+FWy04QZDXRT3CC0eUMTojtTQfmVRv8hMFzEjcauzaeK0z0gJPdO5QdYd3DK1y6HFFaI+ofteExp JkA1kczCrBIrwAr//sat9EM7yezabx06V15Ujy54W/C0vHh3ZEcIFFSGBnujzLUzluSFQCbVAVNJ8 ZF2u8JQ4wOM3U1vL6GeZDsoQDYT53cOtoXMWlDlbrymYHsrvPL9bcVb/UDZj4xsvXwva1Dw/w8skF LekIIN7gk5J76eIJLkb2qFW22wbjodOaKeCIslScHvvjXkH8vNEOssuLHsGHv6UL0Qo1ZDvRuEX3M w24K75bQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1suaLc-0000000DLET-1G8U; Sat, 28 Sep 2024 16:31:08 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1suaKP-0000000DL5O-44Al for linux-arm-kernel@lists.infradead.org; Sat, 28 Sep 2024 16:29:55 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 2FCB2A406C4; Sat, 28 Sep 2024 16:29:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31187C4CEC3; Sat, 28 Sep 2024 16:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727540992; bh=f7It2CatrjhmD2pcjpPk4oE/AIT6Ex9NUsQxqsMgh0c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZrQJx65OhK6f12Q23BR5WzIdCRCFiUu3mSVHZSSFMWrFkhe0RQCly7Y1B9jzzG3Sd xsUxCx6Z2qXOiWudsogTHV6pTkE82r92WR4qkabGM5+106uENLSe7uhYtg9T950ita x/S9wQ9XGvtXkNRsEVcIumeF+yoF2t5CjGdmT92oW+uZiEieuXJm9RPZbVZCVsIl3S j7a5RI2+MdMYqRr4Qgo7dcHntvLcNjR9GBdu73mOCeIoUxTpiODFqkRA8ZXOGAURed H8CG9dRgrVzAunPkiyvyx585N1qEtXjlOR9/zqzG78cY1Ap8NQlP8YhK29p52DJLD1 1pHWUhT7XnLUQ== Date: Sat, 28 Sep 2024 17:29:44 +0100 From: Jonathan Cameron To: Javier Carrasco Cc: Lars-Peter Clausen , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Michael Hennerich , linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH 0/4] iio: adc: use scoped device_for_each_childe_node() Message-ID: <20240928172944.10da3b60@jic23-huawei> In-Reply-To: <20240926-iio_device_for_each_child_node_scoped-v1-0-64ca8a424578@gmail.com> References: <20240926-iio_device_for_each_child_node_scoped-v1-0-64ca8a424578@gmail.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240928_092954_106633_A816CF08 X-CRM114-Status: GOOD ( 17.19 ) 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 On Thu, 26 Sep 2024 18:08:36 +0200 Javier Carrasco wrote: > The device_for_each_child_node() macro requires calls to > fwnode_handle_put() upon early exits (break/return), and that has been a > constant source of bugs in the kernel. > > This series switches to the more secure, scoped version of the macro > in the IIO subsystem, wherever the loop contains error paths. This > change simplifies the code and removes the explicit calls to > fwnode_handle_put(). In all cases the child node is only used for > parsing, and not assigned to be used later. > > The straightforward uses of the loop with no error paths have been left > untouched, as their simplicity justifies the non-scoped variant. > > Signed-off-by: Javier Carrasco All look good to me. I'll be rebasing on rc1 anyway, so there is plenty of time for any other reviews to come in. In meantime I've queued these up on the testing branch of iio.git. Thanks, Jonathan > --- > Javier Carrasco (4): > iio: adc: qcom-pm8xxx-xoadc: use scoped device_for_each_child_node() > iio: adc: qcom-spmi-vadc: use scoped device_for_each_child_node() > iio: adc: sun20i-gpadc: use scoped device_for_each_child_node() > iio: adc: ad5755: use scoped device_for_each_child_node() > > drivers/iio/adc/qcom-pm8xxx-xoadc.c | 8 +++----- > drivers/iio/adc/qcom-spmi-vadc.c | 7 ++----- > drivers/iio/adc/sun20i-gpadc-iio.c | 7 ++----- > drivers/iio/dac/ad5755.c | 11 +++-------- > 4 files changed, 10 insertions(+), 23 deletions(-) > --- > base-commit: 92fc9636d1471b7f68bfee70c776f7f77e747b97 > change-id: 20240926-iio_device_for_each_child_node_scoped-cb534e6f5d9b > > Best regards,