lkml.org 
[lkml]   [2022]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] virtio_ring: Drop unnecessary initialization of detach_buf_packed
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

\
 
 \ /
  Last update: 2022-09-28 00:30    [W:0.045 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site