• Dominique Martinet's avatar
    9p: virtio: skip incrementing unused variable · f41b402d
    Dominique Martinet authored
    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: default avatarSimon Horman <simon.horman@corigine.com>
    Signed-off-by: default avatarDominique Martinet <asmadeus@codewreck.org>
    Signed-off-by: default avatarEric Van Hensbergen <ericvh@kernel.org>
    f41b402d
trans_virtio.c 20.8 KB