linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: trix@redhat.com
Cc: mst@redhat.com, jasowang@redhat.com, ndesaulniers@google.com,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] virtio_ring: Initialize vring_size_in_bytes
Date: Mon, 7 Mar 2022 10:54:24 -0700	[thread overview]
Message-ID: <YiZG0Nx9j++bJaA4@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20220307174916.892433-1-trix@redhat.com>

On Mon, Mar 07, 2022 at 09:49:16AM -0800, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
> 
> On the clang build, there is this error
> virtio_ring.c:1772:26: error: variable 'ring_size_in_bytes'
>   is uninitialized when used here
>   vring_free_queue(vdev, ring_size_in_bytes,
>                          ^~~~~~~~~~~~~~~~~~
> 
> ring_dma_addr was intialized twice, once with the ring_size_in_bytes.
> value.  So fix typo.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

I was getting ready to send the same patch.

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  drivers/virtio/virtio_ring.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index 905c882600618..b2b567ebb9120 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -1756,7 +1756,7 @@ static void vring_free_vring_packed(struct vring_packed *vring,
>  	ring                  = vring->ring;
>  	driver                = vring->driver;
>  	device                = vring->device;
> -	ring_dma_addr         = vring->ring_size_in_bytes;
> +	ring_size_in_bytes    = vring->ring_size_in_bytes;
>  	event_size_in_bytes   = vring->event_size_in_bytes;
>  	ring_dma_addr         = vring->ring_dma_addr;
>  	driver_event_dma_addr = vring->driver_event_dma_addr;
> -- 
> 2.26.3
> 
> 

      reply	other threads:[~2022-03-07 17:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 17:49 [PATCH] virtio_ring: Initialize vring_size_in_bytes trix
2022-03-07 17:54 ` Nathan Chancellor [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=YiZG0Nx9j++bJaA4@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mst@redhat.com \
    --cc=ndesaulniers@google.com \
    --cc=trix@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).