Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1780021lqm; Fri, 3 May 2024 06:30:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXNEO3SsZ1F85KU0gwehKDbuaP6++P1dmSkhqQqrs8YqtN9kG2ExQ+sO+KZJwpjZ6zXXAIOc2JDQFf0vh9Og+eZt1abfeRgFmMpxj4RvQ== X-Google-Smtp-Source: AGHT+IHiBe5IUfZh1ztO5rTzmSJV8PyiWrMI8qMODu/eQOPp99RXcb8Sg6ZBGRKxRNARe6/e4pHM X-Received: by 2002:a05:6122:1da1:b0:4d4:2069:eafb with SMTP id gg33-20020a0561221da100b004d42069eafbmr2499987vkb.9.1714743055547; Fri, 03 May 2024 06:30:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714743055; cv=pass; d=google.com; s=arc-20160816; b=L/D/9iDO6IBBwLQCtu4Is5gpoJP8uQI/VL7Nh7AW7b6i9odMGUXTSIFIlEEyDKvtW5 L/PljToJM9FUv1sNX/YwfAY9xZKwhHKxVKyvtu0T41tsY2fybRD8XnTCPWm3Cq/CB8z2 r5FwtozW7KUlJN/8jl2+cWrxiW8rPSvfiUn7vQtJMTkAyJoi8ZLiTPdGeTnIBHxgbe9S 1R4U7KuttouuG/vnPWctS4LWMAQ7RnMEhhrIYQsdZUoCgrY0J2D5Bfu4EwX+jow6UHQE 7HDH2HVG0R1pwtfFhrY/1N5Y5LrOx8ZtGsgVEFSRl1FretREdu1GhbKLv409TOe+mvoZ Xf8w== 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=HzdXXWTRk9SGH7Wc5O5KEk94ADzNzNWFsSoRYrGI10M=; fh=aCPfZoWjYCT4bskTPU7t4CxLrd9oM8AfgYllv5lP6YE=; b=R9vXXvx4soP1ti1WSySyAFEiwHCiESGWwS47r2hPrYbjR0JKD88p5F8TKxzzOEgqKC q0g/cKRKO6ARVegAW6ErhAkqYqqYXHjDx8Z7NgZoPv7EUg2AgI84xNdBwuc7eF6DqvWg e0WvxFbrNCmWdPxQwYFvAQOLJFRMMtXglVzMStfGSRox1TBp5O0vFZI7UmOTKHBNI4BP Pi6WO2/1MetQvkXGI9fAwr2i0MtGB+sQRNjdqKlJiInT5tZvX9v3qfcgjcN+ASvv2F0a YNwCKID5e+3RZN5BU3EY9N2LVeFWNACt3DLaqeW0mOxy98h+1EKNaYiOYgpDVtCPLffd j/Bg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QvhTzU7m; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-167706-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167706-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e1-20020a1fe701000000b004dee54fc661si565440vkh.230.2024.05.03.06.30.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 06:30:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167706-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QvhTzU7m; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-167706-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167706-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 3D62A1C228E5 for ; Fri, 3 May 2024 13:30:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27C6B153BD8; Fri, 3 May 2024 13:30:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QvhTzU7m" 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 2B96215383F; Fri, 3 May 2024 13:30:42 +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=1714743043; cv=none; b=b58mU+XymrKywELvCAZr0Wngn4K9lMvxnaSA7drSgx9P6AyKRxTYMTA86MrekvlPnBL8OP3/DyAl2rIc/wy0Omfbu9veK1+F+rN0Al7kUrsofatU7Ne5xT8BvUmL0abVWs4nvQxe0d7krp2j4QJXdTr+i4ueUQd94bE2mQMcJFI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714743043; c=relaxed/simple; bh=A7dzyePxuFRV9t0HZbbsE57jhBBAmttYWYl3rdnPMI0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TBewXaK6+olItUvngghHSnfi2nA/nilDF42Ve/KNCWwmGsgTlTghGBPLjjrSQ7XjRfLZCF52Z66VKwjFTQPe1Dfki27wzPwY+bBzljsrP3nn1Np5nXqlZc9ZfiRyCMaeeDkQ4wrwiB6ughIAr5H+sVrCmNnf0zUFs1jWK5r6W+M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QvhTzU7m; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 240C3C2BBFC; Fri, 3 May 2024 13:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714743042; bh=A7dzyePxuFRV9t0HZbbsE57jhBBAmttYWYl3rdnPMI0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QvhTzU7m/riWYaloVcIJAcV7kqeW6FBOCokBVjYbFqDfHlSfpX8XWqq/Qv8ywnD/n 0wyeYej37U/WtHfT0tXtrJ7rv2+6PJ73GqYWp4dJ/TNOa5jTmrxDMvWu2VdHAW7T1+ cSy6KJS8K+7W9i288JHBMXHbJDBMdZyC2qz1GiMY= Date: Fri, 3 May 2024 15:30:36 +0200 From: Greg KH To: Lu Dai Cc: npiggin@gmail.com, christophe.leroy@csgroup.eu, naveen.n.rao@linux.ibm.com, mpe@ellerman.id.au, jirislaby@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, javier.carrasco.cruz@gmail.com, shuah@kernel.org Subject: Re: [PATCH] tty: hvc: hvc_opal: eliminate uses of of_node_put() Message-ID: <2024050313-lustrous-handcraft-0b84@gregkh> References: <20240503114330.221764-1-dai.lu@exordes.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: <20240503114330.221764-1-dai.lu@exordes.com> On Fri, May 03, 2024 at 02:43:30PM +0300, Lu Dai wrote: > Make use of the __free() cleanup handler to automatically free nodes > when they get out of scope. > > Removes the need for a 'goto' as an effect. > > Signed-off-by: Lu Dai > --- > drivers/tty/hvc/hvc_opal.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c > index 095c33ad10f8..67e90fa993a3 100644 > --- a/drivers/tty/hvc/hvc_opal.c > +++ b/drivers/tty/hvc/hvc_opal.c > @@ -327,14 +327,14 @@ static void udbg_init_opal_common(void) > > void __init hvc_opal_init_early(void) > { > - struct device_node *stdout_node = of_node_get(of_stdout); > + struct device_node *stdout_node __free(device_node) = of_node_get(of_stdout); > const __be32 *termno; > const struct hv_ops *ops; > u32 index; > > /* If the console wasn't in /chosen, try /ibm,opal */ > if (!stdout_node) { > - struct device_node *opal, *np; > + struct device_node *opal __free(device_node), *np; *np needs to be on a separate line, right? thanks, greg k-h