summaryrefslogtreecommitdiffstats
path: root/net/9p
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2023-05-03 09:49:28 +0200
committerEric Van Hensbergen <ericvh@kernel.org>2023-07-20 21:14:50 +0200
commitf41b402d2572e93bee85669ed05eb5e1f3725704 (patch)
tree450f96bdf470dc2286005d929296e0a854c4991b /net/9p
parent9p: virtio: make sure 'offs' is initialized in zc_request (diff)
downloadlinux-f41b402d2572e93bee85669ed05eb5e1f3725704.tar.xz
linux-f41b402d2572e93bee85669ed05eb5e1f3725704.zip
9p: virtio: skip incrementing unused variable
Fix the following scan-build warning: net/9p/trans_virtio.c:504:3: warning: Value stored to 'in' is never read [deadcode.DeadStores] in += pack_sg_list_p(chan->sg, out + in, VIRTQUEUE_NUM, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I'm honestly not 100% sure about this one; I'm tempted to think we could (should?) just check the return value of pack_sg_list_p to skip the in_sgs++ and setting sgs[] if it didn't process anything, but I'm not sure it should ever happen so this is probably fine as is. Just removing the assignment at least makes it clear the return value isn't used, so it's an improvement in terms of readability. Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org> Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
Diffstat (limited to 'net/9p')
-rw-r--r--net/9p/trans_virtio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index f3f678289423..e305071eb7b8 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -501,8 +501,8 @@ req_retry_pinned:
if (in_pages) {
sgs[out_sgs + in_sgs++] = chan->sg + out + in;
- in += pack_sg_list_p(chan->sg, out + in, VIRTQUEUE_NUM,
- in_pages, in_nr_pages, offs, inlen);
+ pack_sg_list_p(chan->sg, out + in, VIRTQUEUE_NUM,
+ in_pages, in_nr_pages, offs, inlen);
}
BUG_ON(out_sgs + in_sgs > ARRAY_SIZE(sgs));