Remove the unused but set variable vq in vhost_transport_send_pkt() to fix the following GCC warning when building with 'W=1': drivers/vhost/vsock.c:198:26: warning: variable ?vq? set but not used Signed-off-by: Tobias Klauser <tklauser at distanz.ch> --- drivers/vhost/vsock.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index e3b30ea9ece5..9c3c68b9a49e 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -195,7 +195,6 @@ static int vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) { struct vhost_vsock *vsock; - struct vhost_virtqueue *vq; int len = pkt->len; /* Find the vhost_vsock according to guest context id */ @@ -205,8 +204,6 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) return -ENODEV; } - vq = &vsock->vqs[VSOCK_VQ_RX]; - if (pkt->reply) atomic_inc(&vsock->queued_replies); -- 2.11.0.rc0.7.gbe5a750
On Fri, Nov 11, 2016 at 02:26:31PM +0100, Tobias Klauser wrote:> Remove the unused but set variable vq in vhost_transport_send_pkt() to > fix the following GCC warning when building with 'W=1': > > drivers/vhost/vsock.c:198:26: warning: variable ?vq? set but not used > > Signed-off-by: Tobias Klauser <tklauser at distanz.ch> > --- > drivers/vhost/vsock.c | 3 --- > 1 file changed, 3 deletions(-)Reviewed-by: Stefan Hajnoczi <stefanha at redhat.com> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 455 bytes Desc: not available URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20161115/18d681c6/attachment.sig>
Michael S. Tsirkin
2016-Dec-15 04:54 UTC
[PATCH] vhost/vsock: Remove unused but set variable
On Fri, Nov 11, 2016 at 02:26:31PM +0100, Tobias Klauser wrote:> Remove the unused but set variable vq in vhost_transport_send_pkt() to > fix the following GCC warning when building with 'W=1': > > drivers/vhost/vsock.c:198:26: warning: variable ?vq? set but not used > > Signed-off-by: Tobias Klauser <tklauser at distanz.ch>doesn't apply anymore.> --- > drivers/vhost/vsock.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c > index e3b30ea9ece5..9c3c68b9a49e 100644 > --- a/drivers/vhost/vsock.c > +++ b/drivers/vhost/vsock.c > @@ -195,7 +195,6 @@ static int > vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) > { > struct vhost_vsock *vsock; > - struct vhost_virtqueue *vq; > int len = pkt->len; > > /* Find the vhost_vsock according to guest context id */ > @@ -205,8 +204,6 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) > return -ENODEV; > } > > - vq = &vsock->vqs[VSOCK_VQ_RX]; > - > if (pkt->reply) > atomic_inc(&vsock->queued_replies); > > -- > 2.11.0.rc0.7.gbe5a750 >
Apparently Analagous Threads
- [PATCH] vhost/vsock: Remove unused but set variable
- [PATCH] vhost/scsi: Remove unused but set variable
- [PATCH] vhost/scsi: Remove unused but set variable
- [klibc:update-dash] jobs: Don't attempt to access job table for job %0
- [klibc:update-dash] dash: jobs: Don't attempt to access job table for job %0