printk: remove obsolete dead assignment
authorLukas Bulwahn <lukas.bulwahn@gmail.com>
Mon, 30 Nov 2020 12:49:15 +0000 (13:49 +0100)
committerPetr Mladek <pmladek@suse.com>
Tue, 8 Dec 2020 15:31:28 +0000 (16:31 +0100)
Commit 849f3127bb46 ("switch /dev/kmsg to ->write_iter()") refactored
devkmsg_write() and left over a dead assignment on the variable 'len'.

Hence, make clang-analyzer warns:

  kernel/printk/printk.c:744:4: warning: Value stored to 'len' is never read
    [clang-analyzer-deadcode.DeadStores]
                          len -= endp - line;
                          ^

Simply remove this obsolete dead assignment here.

Link: https://lore.kernel.org/r/20201130124915.7573-1-lukas.bulwahn@gmail.com
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
kernel/printk/printk.c

index fe64a49344bf5231fbc80fc8f8a26d714accbe07..6bffb01431dd2fa3d6abf311d11266b146d62328 100644 (file)
@@ -741,7 +741,6 @@ static ssize_t devkmsg_write(struct kiocb *iocb, struct iov_iter *from)
                        if (LOG_FACILITY(u) != 0)
                                facility = LOG_FACILITY(u);
                        endp++;
-                       len -= endp - line;
                        line = endp;
                }
        }