]> www.infradead.org Git - linux-platform-drivers-x86.git/commitdiff
kernel/relay.c: drop unneeded initialization
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Fri, 16 Oct 2020 03:13:25 +0000 (20:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Oct 2020 18:11:22 +0000 (11:11 -0700)
The variable 'consumed' is initialized with the consumed count but
immediately after that the consumed count is updated and assigned to
'consumed' again thus overwriting the previous value.  So, drop the
unneeded initialization.

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://lkml.kernel.org/r/20201005205727.1147-1-sudipm.mukherjee@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/relay.c

index fb4e0c530c080992ba8eeb8d84422439acc13308..b08d936d5fa75b58651ad40192d42373c5ff773c 100644 (file)
@@ -1002,7 +1002,7 @@ static int relay_file_read_avail(struct rchan_buf *buf)
        size_t subbuf_size = buf->chan->subbuf_size;
        size_t n_subbufs = buf->chan->n_subbufs;
        size_t produced = buf->subbufs_produced;
-       size_t consumed = buf->subbufs_consumed;
+       size_t consumed;
 
        relay_file_read_consume(buf, 0, 0);