public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Clement Amar <clementamar@gmail.com>
Cc: "Jason Wang" <jasowang@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	virtualization@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] virtio: simplify of_node handling in virtio_device_of_init
Date: Mon, 6 Apr 2026 05:26:17 -0400	[thread overview]
Message-ID: <20260406052552-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260406092159.136447-1-clementamar@gmail.com>

On Mon, Apr 06, 2026 at 11:21:59AM +0200, Clement Amar wrote:
> Replace goto with return for simple error
> 
> Signed-off-by: Clement Amar <clementamar@gmail.com>

I don't see the point, sorry.

> ---
>  drivers/virtio/virtio.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> index 5bdc6b82b..b49113ea8 100644
> --- a/drivers/virtio/virtio.c
> +++ b/drivers/virtio/virtio.c
> @@ -493,16 +493,12 @@ static int virtio_device_of_init(struct virtio_device *dev)
>  	 * Simply don't init of_node in this case.
>  	 */
>  	if (!of_device_is_compatible(np, compat)) {
> -		ret = 0;
> -		goto out;
> +		of_node_put(np);
> +		return 0;
>  	}
>  
>  	dev->dev.of_node = np;
>  	return 0;
> -
> -out:
> -	of_node_put(np);
> -	return ret;
>  }
>  
>  /**
> -- 
> 2.43.0


      reply	other threads:[~2026-04-06  9:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-06  9:21 [PATCH] virtio: simplify of_node handling in virtio_device_of_init Clement Amar
2026-04-06  9:26 ` Michael S. Tsirkin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260406052552-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=clementamar@gmail.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox