Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp454349lqm; Wed, 1 May 2024 06:06:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTi1E0dgQ6hjM/DKJbjYXW0ASn3ZKj7UdKVVoliMWIQz9z873NUiBBIdWBTXoLdO/e7M2G6qvEa8T4UdoVOJbuYklFQegBclhrwWFLbw== X-Google-Smtp-Source: AGHT+IGaDFaFycaYQclwRjbxR9qqFICN4xzoaXc+R0fJhBibMJWFaIZlc/o1Y2PNMGGXCCwoZSr/ X-Received: by 2002:ad4:5de1:0:b0:6a0:c8da:5cb2 with SMTP id jn1-20020ad45de1000000b006a0c8da5cb2mr2275038qvb.3.1714568789292; Wed, 01 May 2024 06:06:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714568789; cv=pass; d=google.com; s=arc-20160816; b=fKmUJRJrH7H7PEmpZ9w2xsTq5s6B39rmezODRJn7MpQ07WD9TVDpdWy6v6kKSfbYXd toHaf6WS31idl/vN1B95q7pATgpIVpn/wXcahNz+vNCWvQ2WyhdARENPrzvm20Ccr7If XwDOHKskvacoRhcKXClUwKfwIery7JXHFAKcr6dZ4uuf/ZQU3cDMqoAF5TROEUETu1Io EDKb2l9II/uotySno/4WRGdwn1eJn/o2D4nfRzMtiMM9Q9M1YrFEMmkxUtrUeSBD0agX MbF5f5u+ZicxJztZ/mE+dN7LCG0HLRt3c9shbi9vV7ZBWNLZEoaFhGwTfQ06L2+HJPd3 sfWQ== 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=VPtytgnZW977w1c+KEeN/IofD9AKCWwM3yaigcfB7wQ=; fh=Hty8IgDqs1Hlf8JiKW//aDxQ1SGVD3IOEAcRY34JjLc=; b=uJK1YZbwwE1rB7l4XmuRnWcrqUFzXy7YQc9q279crSGNN/GhjTq5tGlhb1Xl3wvCvq Iwj8+4SneBaovCouyRGZd5ftjysuRDIW413WfWGTKz6I/Bct8CLpE2jFcMwlMSfmaIpt TTZkaD6sQrv9a9Ii33qrkk6fPacg6SE1HEEICdbu0gfb/6F8lf/lisz8bA4e78aUKb1W dQrRe31cpVDK1KSbKzFLtNkgsA7GOqeGrnZYLWLR1sAcN44wsjvEB7GoW0kPDmFmHOvd eicH7bhmpr4mjr8e0NvYjXd7UXbyv8H3BBR0/1w/pxmy0AdPkd3mOtAKOxpDVUmTvpHv c1iA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C7abI0xi; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-165298-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165298-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q1-20020a056214194100b0069b4f599635si32913939qvk.231.2024.05.01.06.06.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 06:06:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165298-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C7abI0xi; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-165298-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165298-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 09E061C21714 for ; Wed, 1 May 2024 13:06:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2E5A12CD91; Wed, 1 May 2024 13:06:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="C7abI0xi" 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 14D04152795 for ; Wed, 1 May 2024 13:06:22 +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=1714568783; cv=none; b=dabGh0LNDg7ZF63c1GlefzUVh8XNndBuBAzuFLyJNQ6i6mwR/If/BO7821CNEs+DdgjTv/2HXp2lvgyhbRhj6rGwGSSY8R2rNifcxzomthBrWbK4itRkw4JEfEDTjmUSlAjQsH0Hlb/mPUKI81ApoBZczCEPXl00wzVVMuqAKWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714568783; c=relaxed/simple; bh=V2kVE6wZDPJ3w0WsZm4Q/spr0mr8CyMrPVob/eNBi5A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Zcf2+DlbdtuZ33LfV2Qog4RjdDDZd58tPv7QIEB45bv7LgmagCIeAkiv80EN7avzf96e9Ng1CyYrq6OaNntXWVUte5fmMdEo8gD4w6ssTJtglM3t44DHOX7pnyPxtWNFGYltLHzGs9rXfntymmAfsize0vBDkGEtxaPFpaxRiwA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=C7abI0xi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB54EC113CC; Wed, 1 May 2024 13:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714568782; bh=V2kVE6wZDPJ3w0WsZm4Q/spr0mr8CyMrPVob/eNBi5A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C7abI0xifRwA0J1yZGGfZUl1ZHHl4lm87k1NkMwShCOQTciVWJ0on90gXWYBGVI9n 2oEgs/PQjhQDM/GksVWn+lRS+tCSGoOABwqQdQHt8CLSlmP1lO/aiWhydm4ToF+aj+ qmJDbp3rizWLZskPcmgGR2cJqto8zB5e55TJUr84= Date: Wed, 1 May 2024 15:06:19 +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: <2024050148-dutiful-unsubtle-dbb1@gregkh> References: <20240424125401.oxvt5n64d7a57ge3@bogus> <20240501094313.407820-1-vincenzo.mezzela@gmail.com> <20240501094313.407820-3-vincenzo.mezzela@gmail.com> <2024050102-reshuffle-licking-f84e@gregkh> <673df61a-e0f5-450b-8fb4-746bc950e3d1@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: <673df61a-e0f5-450b-8fb4-746bc950e3d1@gmail.com> On Wed, May 01, 2024 at 02:33:39PM +0200, Vincenzo Mezzela wrote: > On 01/05/24 12:48, Greg KH wrote: > > 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 > > Hi, > > I just cross-compiled it for RISC-V to enable the config > GENERIC_ARCH_TOPOLOGY > and include arch_topology.c as well. Cross-compile is nice, how about running it? > Do you have any suggestion to trigger the affected code and perform some > testing? That is up to you to determine if you wish to modify it :) thanks, greg k-h