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 55AC4C636EE for ; Wed, 28 Aug 2024 18:12:14 +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=EY/qF5pMoxFnOLgWyHNpw8ZBTSApaXAx9i/65TjQcyY=; b=xG9Ui0Dc9jdtG5h4EGrfGOqWZG v8lBiFaAG20lAmX/CeJwnblAjfXqq4qzltu/FkuW8q6vjG7jn/9BUdv7PNne28CuaIWRu6Eskwlwn fxweA4XqRxNVMJAwthIShe3fqPQyWp/m+5cBKoZg4dzcfbOdYbhNhhQ4e+CKNOLY/2SlBOOI2jKvy Fw5GVbU0KtZFUTPBqOrE5OlgCv6YMRCwQHcT8YhBJ7GwM5tqbTql2qS3NdY751XVM9C3lYQSRADXB djSbNHE17aNVP6qPzXRMcGT960Z6ekFT5c8HM72kp6od/Z0iFbIhnDBY0jeJ8zsePNW7FiKJzFmR6 1EhfPSqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjN9I-0000000GV0X-2kjE; Wed, 28 Aug 2024 18:12:04 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjN85-0000000GUgN-1gEo for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2024 18:10:50 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 2E777AE2A1F; Wed, 28 Aug 2024 18:10:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12471C4CEC0; Wed, 28 Aug 2024 18:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724868647; bh=BLWFViZHyhfvUvUKzWyXSIKJCD0OeyNnNaETiXaafdA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Z1sipsWpuNXKP+EOz6AL6w/fPKCe1izfUeP1TLDV4jTuBM8Pj5WwIHJZv/5wkVS5z fCAChL1rCsdgyblCaFMvYGC1soBs6KWFaWLkCJocYbXmltsjwOxeS5sSsU4cbA9kG/ +iokNUm8LrSXg5Nm85d7OSywxmqqJGSjfbPAJryEHs6zlYK2OT/fPzLlXjbOVrVXXw 33KIaV3vl08lsNHVR1EAZ/vlIN2sefXmfIoZagjtQvbapHyJpfYJgdNExUKjC5jPlA 2jj4rn41vLLE9NH5gVZupLtUo5xV4HIPo4Wh0s84eJeF4Rs5XPG7sSbhoFaQcM5OP1 RpmJnWcc/yPIA== Date: Wed, 28 Aug 2024 11:10:45 -0700 From: Jakub Kicinski To: Krzysztof Kozlowski Cc: Andrew Lunn , Jinjie Ruan , woojung.huh@microchip.com, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, linus.walleij@linaro.org, alsi@bang-olufsen.dk, justin.chen@broadcom.com, sebastian.hesselbarth@gmail.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, hkallweit1@gmail.com, linux@armlinux.org.uk, ansuelsmth@gmail.com, UNGLinuxDriver@microchip.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, jic23@kernel.org Subject: Re: [PATCH net-next v2 00/13] net: Simplified with scoped function Message-ID: <20240828111045.11dfc157@kernel.org> In-Reply-To: <71deb322-4b54-4c1c-a665-d9de84ea9baf@kernel.org> References: <20240828032343.1218749-1-ruanjinjie@huawei.com> <6092e318-ae0c-44f6-89fa-989a384921b7@lunn.ch> <71deb322-4b54-4c1c-a665-d9de84ea9baf@kernel.org> 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-20240828_111049_618137_2A581E3D X-CRM114-Status: GOOD ( 15.20 ) 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 Wed, 28 Aug 2024 16:45:32 +0200 Krzysztof Kozlowski wrote: > On 28/08/2024 16:32, Andrew Lunn wrote: > > On Wed, Aug 28, 2024 at 11:23:30AM +0800, Jinjie Ruan wrote: > >> Simplify with scoped for each OF child loop and __free(), as well as > >> dev_err_probe(). > >> > >> Changes in v2: > >> - Subject prefix: next -> net-next. > >> - Split __free() from scoped for each OF child loop clean. > >> - Fix use of_node_put() instead of __free() for the 5th patch. > > > > I personally think all these __free() are ugly and magical. Can it > > It is code readability so quite subjective. Jakub also rejected one of > such __free() changes, so maybe all these cases here should be rejected? Andrew's comments on refcounting on DT objects notwithstanding -- I do like the _scoped() iterator quite a bit, FWIW. I think it's one of the better uses of the auto-cleanup and local variable declarations. Direct uses of __free() are more questionable in my opinion. Using advanced constructs to build clean subsystem APIs is great, sprinkling unreadable constructs to save LoC is what C++ is for. (Lets see how many people this offends ;))