Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3148200lqo; Wed, 15 May 2024 00:38:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXG+3wyn4yqJXfvOXMnq9z0XU4HR63z+IuU4nS5pjvi3sPBpbxnQDuf8OWcHopgUffioZMD3/4WgUinwwU3sVVMeQ9B1Kwg5/hl1xLCbQ== X-Google-Smtp-Source: AGHT+IEKPXkdaeYnZEttB8+7ouN9/IHWrOQaSSz1kWSmAOKyEoVEGCrrsTIfws8updBBbQQEbNqp X-Received: by 2002:a05:6512:b90:b0:51b:58c7:d04d with SMTP id 2adb3069b0e04-5220f6487damr11025004e87.0.1715758726533; Wed, 15 May 2024 00:38:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715758726; cv=pass; d=google.com; s=arc-20160816; b=o+OT0PrsD9UaeVaiRBPfrHEyVLR47vnat3Ir9Ghl48ePwDYhDzCFv9dderTWDjqtLw ILhG6Qr5JkRn/K7vmakF1vLZzVXeUDVVMvkBRLlNZ8LSjghnTe1UX94EyXBeM3uOyCfR zGWvfozNwkc1ZHrEmor7e/dcgVBWOqvrYtxR4+NMaGRL835tCtwqSk54ZyTw1PKJ250k R8eajt4/PgcFhVCsXQCDJdx4kQ2kauTA9uM8LFg8BrZTDahuTqcc8Q+70+Xx1z72JCLe rQ+yfUaObvlRhBL+exfALUpIzaw8GQVgMG/t4t12/0eko6qjxKm3KPlgVRi6zw3KDJuK WLig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=JWlVGgM4WxsBCRWGiN8tEacLiYuKgkna6fVzADW0xEU=; fh=VrZ697TPjg0VRZrDHR+17B2WJPfzPYlSBGShU16h/qo=; b=bsxCfPIvj7sGFYV1s4n/5hPIBwBpSlJhqvN53fh1YBQhCc6RyYw0CkP8HkZfVjat0G BYT/DZffWA3PKbJ0Hs8jQcj31TlBsk/fy2ZrkQ8alBIVJ2ZvbMiNVP8ZrhA7MoPBhxYi aID0bKAqIAGcdL0pYx3jf3ZG2onjBiaQp3/Xj7Lh+a8zIP+Rac5RzOcoAaTi3F1rA9Za FPHxGGLJyk9aGfFYqQioZaDMXUMcA7UzDOF85bgFMxWhCvoxt5f/6irC+J9TXl1hJCTh xxB9inLYu/RyEWICScUHDANX0/tlGPG9p9E3J9WBysyO4RDjKrohUl9pjTTOaGx4QuZp zPmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=c4O8ie8v; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-kernel+bounces-179591-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c327442si7082282a12.380.2024.05.15.00.38.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 00:38:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179591-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=c4O8ie8v; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-kernel+bounces-179591-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3BB421F219F5 for ; Wed, 15 May 2024 07:38:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A391747F6B; Wed, 15 May 2024 07:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b="c4O8ie8v" Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (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 A8E5B44C88 for ; Wed, 15 May 2024 07:38:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.134.164.83 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715758710; cv=none; b=qd76TXdFFS8DhJPSMAcwoBvi3cxfM/xDefHnGyZfSiIZF5Dg7Xr4GZiE5a83buSVBeWr1WBpzOHpGW6WtIuKPvmTOfyUTFr3GrrSrlC6aXMprYNYNO9lglxHTxaNLopJcuO06ZhXDEKI5pQKvh8RJN6YtXV8TB4M9PBYBskYHLk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715758710; c=relaxed/simple; bh=M2DcaQa022yKAMxlKJ/RtcE7iTKuJE0pwFr9vLVuqbs=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=soXEv8yWy5yLlnjMwjq9koZpaCcHeJKY7CJrM/qC9lkLDwhQmIVo++J2azU+Dsu0TvbEhZ0Ya3Qv7pdBx7LDGKJV47B5q7qYq98aeTp84a3ENZViyzi9eDvHuIXw9h02SvThPrd2+O8ez8Z553yBa+8ItnsowNIpvmlwvFujJKw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr; spf=pass smtp.mailfrom=inria.fr; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b=c4O8ie8v; arc=none smtp.client-ip=192.134.164.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=JWlVGgM4WxsBCRWGiN8tEacLiYuKgkna6fVzADW0xEU=; b=c4O8ie8vWPJ0uSdN92/luS57dGrcQ9mdKUMBobUBfkY+YaoX7XiTvoak H/lbY3LoO8frvRnQ+SEs6fy4AaN14HO0zZduchtSoram8kRNQGuTzR58Z 2DP8v1bPY/i53qKPKMXrXeJ+E3Dq4H/2JjRNhi7ClAEenIg4VywJ3GX0k E=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.08,161,1712613600"; d="scan'208";a="165794184" Received: from dt-lawall.paris.inria.fr ([128.93.67.65]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 09:38:20 +0200 Date: Wed, 15 May 2024 09:38:19 +0200 (CEST) From: Julia Lawall To: Marilene Andrade Garcia cc: Srinivas Kandagatla , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Shuah Khan , Javier Carrasco , linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nvmem: meson-efuse: Replacing the use of of_node_put to __free In-Reply-To: <768c3e38-724a-42d7-a51d-16044bc69ed5@gmail.com> Message-ID: References: <20240416011751.93016-1-marilene.agarcia@gmail.com> <768c3e38-724a-42d7-a51d-16044bc69ed5@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 On Tue, 14 May 2024, Marilene Andrade Garcia wrote: > On 15/04/2024 22:17, MarileneGarcia wrote: > > Use __free for device_node values, and thus drop calls to > > of_node_put. > > > > The goal is to reduce memory management issues by using this > > scope-based of_node_put() cleanup to simplify function exit > > handling. When using __free a resource is allocated within a > > block, it is automatically freed at the end of the block. > > > > Suggested-by: Julia Lawall > > Signed-off-by: MarileneGarcia > > --- > > drivers/nvmem/meson-efuse.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c > > index 33678d0af2c2..400a9a075e53 100644 > > --- a/drivers/nvmem/meson-efuse.c > > +++ b/drivers/nvmem/meson-efuse.c > > @@ -42,20 +42,19 @@ static int meson_efuse_probe(struct platform_device > > *pdev) > > { > > struct device *dev = &pdev->dev; > > struct meson_sm_firmware *fw; > > - struct device_node *sm_np; > > struct nvmem_device *nvmem; > > struct nvmem_config *econfig; > > struct clk *clk; > > unsigned int size; > > + struct device_node *sm_np __free(device_node) = > > + of_parse_phandle(pdev->dev.of_node, "secure-monitor", 0); > > - sm_np = of_parse_phandle(pdev->dev.of_node, "secure-monitor", 0); There should be a blank line after the last variable declaration, so here. julia > > if (!sm_np) { > > dev_err(&pdev->dev, "no secure-monitor node\n"); > > return -ENODEV; > > } > > fw = meson_sm_get(sm_np); > > - of_node_put(sm_np); > > if (!fw) > > return -EPROBE_DEFER; > > > > Hello everyone, > Did you have a chance to look at the patch? Any questions or suggestions about > it? > > Thank you, > Marilene >