* Re: [PATCH] virtio_ring: Drop unnecessary initialization of detach_buf_packed
[not found] <20220926102946.3097-1-wangdeming@inspur.com>
@ 2022-09-27 4:01 ` Jason Wang
2022-09-27 22:29 ` Michael S. Tsirkin
1 sibling, 0 replies; 2+ messages in thread
From: Jason Wang @ 2022-09-27 4:01 UTC (permalink / raw)
To: Deming Wang; +Cc: virtualization, linux-kernel, mst
On Mon, Sep 26, 2022 at 7:15 PM Deming Wang <wangdeming@inspur.com> wrote:
>
> The variable is initialized but it is only used after its assignment.
>
> Signed-off-by: Deming Wang <wangdeming@inspur.com>
Acked-by: Jason Wang <jasowang@redhat.com>
> ---
> 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 8974c34b40fd..abac0a3de440 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -1544,7 +1544,7 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> static void detach_buf_packed(struct vring_virtqueue *vq,
> unsigned int id, void **ctx)
> {
> - struct vring_desc_state_packed *state = NULL;
> + struct vring_desc_state_packed *state;
> struct vring_packed_desc *desc;
> unsigned int i, curr;
>
> --
> 2.27.0
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] virtio_ring: Drop unnecessary initialization of detach_buf_packed
[not found] <20220926102946.3097-1-wangdeming@inspur.com>
2022-09-27 4:01 ` [PATCH] virtio_ring: Drop unnecessary initialization of detach_buf_packed Jason Wang
@ 2022-09-27 22:29 ` Michael S. Tsirkin
1 sibling, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2022-09-27 22:29 UTC (permalink / raw)
To: Deming Wang; +Cc: linux-kernel, virtualization
On Mon, Sep 26, 2022 at 06:29:46AM -0400, Deming Wang wrote:
> The variable is initialized but it is only used after its assignment.
>
> Signed-off-by: Deming Wang <wangdeming@inspur.com>
The thing to do here is to move the first assigment to the
initialization.
> ---
> 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 8974c34b40fd..abac0a3de440 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -1544,7 +1544,7 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> static void detach_buf_packed(struct vring_virtqueue *vq,
> unsigned int id, void **ctx)
> {
> - struct vring_desc_state_packed *state = NULL;
> + struct vring_desc_state_packed *state;
> struct vring_packed_desc *desc;
> unsigned int i, curr;
>
> --
> 2.27.0
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-27 22:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220926102946.3097-1-wangdeming@inspur.com>
2022-09-27 4:01 ` [PATCH] virtio_ring: Drop unnecessary initialization of detach_buf_packed Jason Wang
2022-09-27 22:29 ` Michael S. Tsirkin
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).