Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp382587lqm; Wed, 1 May 2024 03:48:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVulBqdhgStM4I+Udz6Z6EpaeoSOfwbTCzVb+Dz7OTc75YOu4TT0lECyHUkixyatG6Myxzxt4GvltNcW9sXuMj3Jk2RvuVG/tLJA2NYzw== X-Google-Smtp-Source: AGHT+IFlDswgLa4nWc/WEeIrpP0TjPYW/K5paCCObGoAIxVX1CcIR2iW/sm7V0RQYNRUxMb/7CFA X-Received: by 2002:a17:903:41ca:b0:1eb:57a9:53f1 with SMTP id u10-20020a17090341ca00b001eb57a953f1mr2345966ple.1.1714560517915; Wed, 01 May 2024 03:48:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714560517; cv=pass; d=google.com; s=arc-20160816; b=NvWiQiHf+ukh32dCMQ6B4y2+etnt9FTBVYkhYvugdsZub8mm1Q0s0IoY9dvk+ruVcR zxI4q5ZLTMsL0AjPRa3+SToB7diJxWJ3CpaYypV2DdkAaGuaVxgHFbNaiIjKix0G4oU9 sJFv7W8a2EV88W8FNZsZlWEALzqknlr/IZBu48WmQiccE8IQKNyeb3i1vc90l2WDEcvN 5TAU2UFXzbl/DsrRQNiVT2k6DkcVsExjw+oa8tREFXN4Cx+kdRJ3Vf7qN6pixyABm2V9 fS0VWM0NAgul4lKvndty4sTSCFaApuxppIY++JZ9fm8b2VmiQnjK6FN/TtNamy/P7F09 A7gQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rN11pPchfDgUf9R+ys1bm+AHkeb1iMk8IcxHff8YIgA=; fh=Hty8IgDqs1Hlf8JiKW//aDxQ1SGVD3IOEAcRY34JjLc=; b=RPPEpDp/roud8RTQAPXTfNMWI25sbRmllOGzE2m3nbyXgSR1l4MmxiK8Ji8J8HsQpb Y6yTXISqh4LERgLT9DESjeC9l/vh0iXZB1OP7iCxFNKl5NYQTSMj09fQe9A4j7aBJGRf +BoWsasZnz+1qCChHxkT06sPOlBi8Dw/9198BZeWaWOSdsX4puyixYAOcejomhFuBCyy Ylxo3QXSB6OrDdzS0SL4Nsx/35PpIaM+IXSwLlTlw6m2p2/uNh9uaPeEg55cQV4lREQ/ VOfOo7D6PcphoJl4jQdq7vpaMlO8QAm54n4A+obzICyuAE3gJ07SHtmLek/cmCmDDLva vX8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oa9qVzoJ; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-165155-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165155-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z8-20020a170902ccc800b001e85dc64080si24359798ple.61.2024.05.01.03.48.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 03:48:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165155-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oa9qVzoJ; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-165155-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165155-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 358E7B21BA4 for ; Wed, 1 May 2024 10:48:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CF7054FB8; Wed, 1 May 2024 10:48:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="oa9qVzoJ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 874064F881 for ; Wed, 1 May 2024 10:48:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714560506; cv=none; b=CpdXESKLz18JJHGb5oQIu+A4OG7ZJdlYyp1BeWBtLKmlDG6xbo6Ljq82b1lQP8NjW2xnz8jpuNQ0gKLz7hPGZplpur1rvXXVZU1qp3UnmNpG2qYqMVqOach1TUVeCG2/FZXBPiD/Tg7LGclqjJbsLrjEOxxLw+StWq1K6rPb++o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714560506; c=relaxed/simple; bh=u8/DS5GSXb3ZHLL3dhK/g3K2193p6Ah5X4cQgkYEVvE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KlJhCbGWTMgzBoYWt/kS1s7y6BfL0wU7bkmo6DFVXR4a3PwO0j5OEB0uSmFrRnjrYr2YY/I/uUU0skuPJwLZuqiFC9o5P50ORd6ZAlB2dbz6gqWn/veLL96akDCrUpURxvE+mFzfzfS5HuSa0lsjyaEyk5m2XVqHN1FRjpfae/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oa9qVzoJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F983C113CC; Wed, 1 May 2024 10:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714560506; bh=u8/DS5GSXb3ZHLL3dhK/g3K2193p6Ah5X4cQgkYEVvE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oa9qVzoJg94MPJEDY0dfV9floXpjMGW0z4sXguE5d0R8sjNxiTuUqzP8qQCFxZKPa JUM5bpJBZUTdLQeAXlOWw/ABWPzDo0yuYjqvMhFJNSijox2dtghOjqEkwIepAp1Ghw mUO8MJEEQzy5jePKJG0jB0T/EBl6e1QmkS3LX0OU= Date: Wed, 1 May 2024 12:48:22 +0200 From: Greg KH To: Vincenzo Mezzela Cc: sudeep.holla@arm.com, javier.carrasco.cruz@gmail.com, julia.lawall@inria.fr, linux-kernel@vger.kernel.org, rafael@kernel.org, skhan@linuxfoundation.org Subject: Re: [PATCH 2/2 v3] drivers: use __free attribute instead of of_node_put() Message-ID: <2024050102-reshuffle-licking-f84e@gregkh> References: <20240424125401.oxvt5n64d7a57ge3@bogus> <20240501094313.407820-1-vincenzo.mezzela@gmail.com> <20240501094313.407820-3-vincenzo.mezzela@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240501094313.407820-3-vincenzo.mezzela@gmail.com> On Wed, May 01, 2024 at 11:43:13AM +0200, Vincenzo Mezzela wrote: > Introduce the __free attribute for scope-based resource management. > Resources allocated with __free are automatically released at the end of > the scope. This enhancement aims to mitigate memory management issues > associated with forgetting to release resources by utilizing __free > instead of of_node_put(). > > The declaration of the device_node used within the do-while loops is > moved directly within the loop so that the resource is automatically > freed at the end of each iteration. > > Suggested-by: Julia Lawall > Signed-off-by: Vincenzo Mezzela > --- > drivers/base/arch_topology.c | 51 +++++++++++++++--------------------- > 1 file changed, 21 insertions(+), 30 deletions(-) How was all of this tested? thanks, greg k-h