From: Petr Mladek <pmladek@suse.com>
To: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
John Ogness <john.ogness@linutronix.de>,
Nathan Chancellor <natechancellor@gmail.com>,
Nick Desaulniers <ndesaulniers@google.com>,
linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com,
kernel-janitors@vger.kernel.org, linux-safety@lists.elisa.tech
Subject: Re: [PATCH] printk: remove obsolete dead assignment
Date: Mon, 30 Nov 2020 16:37:33 +0100 [thread overview]
Message-ID: <X8URvRhAB2AE4DZT@alley> (raw)
In-Reply-To: <20201130124915.7573-1-lukas.bulwahn@gmail.com>
On Mon 2020-11-30 13:49:15, Lukas Bulwahn wrote:
> 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.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> ---
> applies cleanly on current master and next-20201130
>
> Petr, please pick this minor non-urgent clean-up patch.
>
> kernel/printk/printk.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index f279d4fbd9dd..6e4e38b7cd91 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -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;
> }
> }
Yup, it was used to write the trailing '\0'. But it is done earlier
now. So, it is not longer needed.
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
PS: I'll give it few days just in case anyone else would want to
review it. I'll push it then unless anyone complains.
next prev parent reply other threads:[~2020-11-30 15:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-30 12:49 [PATCH] printk: remove obsolete dead assignment Lukas Bulwahn
2020-11-30 15:37 ` Petr Mladek [this message]
2020-11-30 15:53 ` Sergey Senozhatsky
2020-12-08 16:00 ` Petr Mladek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=X8URvRhAB2AE4DZT@alley \
--to=pmladek@suse.com \
--cc=clang-built-linux@googlegroups.com \
--cc=john.ogness@linutronix.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-safety@lists.elisa.tech \
--cc=lukas.bulwahn@gmail.com \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox