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 A97A1C87FCD for ; Thu, 29 Aug 2024 18:07:50 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:CC:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wi86ZH7xmqdnGu1sxbaNDApyldso9uas/PyZiPRTSkA=; b=B1SEyzrd6Y2hme5rZJnKGg5Ich vkJCBHe1BLsLaPrwESkzuxeJuR5GNTuHQx7l7gZSTsb3I2/aNuC3Qo800L9Km5XYesFXzRi6I+3QE 3uWQrNq/Sjjmam38KTHQV3vgKvYFQufED5bMzfYffqGVG49mq/0B/7kPspRTSeOgXP11426SeoF88 rr3j/LXQj7HeOlIcqg8fmQCHlxU6f7lISRGc+guuSkR2loaxwlIahoa8Odh8LSrZCW8Q9CIpqRsf+ sPWH4BSm749KMXXQW2eVWr7punaomurgB8ierGTLKR0r2g7Wrmg+Q+GxB2SN6P2Cae3w9DFJ/Ewt8 GB5ArKdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjjYa-0000000385q-0k7k; Thu, 29 Aug 2024 18:07:40 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjjXd-000000037ty-1DXz for linux-arm-kernel@lists.infradead.org; Thu, 29 Aug 2024 18:06:43 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47TI6DLN117367; Thu, 29 Aug 2024 13:06:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1724954773; bh=wi86ZH7xmqdnGu1sxbaNDApyldso9uas/PyZiPRTSkA=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=l/3SQIGeZsyLNLqE7Q8eoxW8LbWkxH5BoY2HW2CjM2BV4vGgIFegJJV2ViWS9mYGP EeYozapcSXDMa6MJBN3lXAu/eUlQB7v6C2yq1UkIe1tc3FVoDNeUWRumzx+vhGCdg2 PD6+EL7f13yT2BUlk4OoO1sPvslP1jjXVnZwlMFM= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47TI6DGn072897 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 29 Aug 2024 13:06:13 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 29 Aug 2024 13:06:13 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 29 Aug 2024 13:06:13 -0500 Received: from localhost (uda0133052.dhcp.ti.com [128.247.81.232]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47TI6D9c076122; Thu, 29 Aug 2024 13:06:13 -0500 Date: Thu, 29 Aug 2024 13:06:13 -0500 From: Nishanth Menon To: Kousik Sanagavarapu CC: Jinjie Ruan , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH -next 8/8] soc: ti: knav_qmss_queue: Simplify with scoped for each OF child loop Message-ID: <20240829180613.upc6xpe7jnhb6eo7@puppy> References: <20240827114607.4019972-9-ruanjinjie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_110641_439878_DD6FBE82 X-CRM114-Status: GOOD ( 15.71 ) 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 21:28-20240829, Kousik Sanagavarapu wrote: > Jinjie Ruan writes: > > @@ -1080,17 +1080,13 @@ static int knav_queue_setup_regions(struct knav_device *kdev, > > { > > struct device *dev = kdev->dev; > > struct knav_region *region; > > - struct device_node *child; > > u32 temp[2]; > > int ret; > > > > - for_each_child_of_node(regions, child) { > > + for_each_child_of_node_scoped(regions, child) { > > Are you sure using *_scoped() is better here? Since it seems that we > need the memory pointed to by "child" in cases where we don't go into an > error path. > > > region = devm_kzalloc(dev, sizeof(*region), GFP_KERNEL); > > - if (!region) { > > - of_node_put(child); > > - dev_err(dev, "out of memory allocating region\n"); > > - return -ENOMEM; > > - } > > + if (!region) > > + return dev_err_probe(dev, -ENOMEM, "out of memory allocating region\n"); > > > > region->name = knav_queue_find_name(child); > > of_property_read_u32(child, "id", ®ion->id); > > Similarly in most of the other cases in this series where a similar > change is done. > > Also FYI, as for dev_err_probe(), I think I covered all of them in this > file and a patch for it is currently sitting in ti-drivers-soc-next. > Thanks Kousik. yeah - it will probably help with a rebase to latest next. -- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D