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 7E7BBCA0ED2 for ; Fri, 30 Aug 2024 03:25:29 +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:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jskhEYFO4dWDo1eZB85w7KcqzQ+vXVwGLas81DDHsWk=; b=ouqEnPmqqoQ0q4noIrSX+DgP0o QAsyYkFb71tmuqDa/tb+CVdOfg1RMwYM4s7cVTmEXmX8j2Z4li70MIpWc5ouA71LI6UECXp8Yzyf1 Hu41+fJ60z+UkCJaWn8zij4BbT+rdzG5hAZiLgcuLuSjVjzTB+FYbgkj+fm87qkUtjWV+ns6mlLP/ Z8K/+6ptBcvexrZR5w7vTAXsSs7em5XSshXdO/H4LJNLvGAadGEf83t1FBrNHAC0PYqFaiTSF/h/S pmzJaoZgzO3tNRYm9B15mK6uGJvzLv9i9yRzeGiT4mt/SeeKDlAKmKZDJQqxXNmKN70tk23QbbNng ifA7aSNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjsGG-00000004VEY-0PlI; Fri, 30 Aug 2024 03:25:20 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjsFM-00000004V1z-2H5w for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 03:24:26 +0000 Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Ww3Ng2NFkzLqyG; Fri, 30 Aug 2024 11:22:11 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 09DCE140202; Fri, 30 Aug 2024 11:24:16 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 30 Aug 2024 11:24:14 +0800 Message-ID: <598efadd-da27-0be3-6d1c-dee50e71c811@huawei.com> Date: Fri, 30 Aug 2024 11:24:14 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH -next 8/8] soc: ti: knav_qmss_queue: Simplify with scoped for each OF child loop Content-Language: en-US To: Kousik Sanagavarapu CC: , , , , , , , , , , , , , , , , , , , References: From: Jinjie Ruan In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.109.254] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemh500013.china.huawei.com (7.202.181.146) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_202424_882157_889B9932 X-CRM114-Status: GOOD ( 11.76 ) 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 2024/8/29 23:58, 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. Hi, Jonathan, could you help review this code? > >> 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