Skip to content

Commit

Permalink
printk: remove obsolete dead assignment
Browse files Browse the repository at this point in the history
Commit 849f312 ("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>
  • Loading branch information
Lukas Bulwahn authored and Petr Mladek committed Dec 8, 2020
1 parent 584da07 commit 8d143c6
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion kernel/printk/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 8d143c6

Please sign in to comment.