From: Chen Zhou <chenzhou10@huawei.com>
To: <keescook@chromium.org>, <arnd@arndb.de>, <gregkh@linuxfoundation.org>
Cc: <linux-kernel@vger.kernel.org>, <chenzhou10@huawei.com>
Subject: [PATCH -next] lkdtm: remove unnecessary terminated-null assign
Date: Sun, 19 Jan 2020 20:36:59 +0800 [thread overview]
Message-ID: <20200119123659.29950-1-chenzhou10@huawei.com> (raw)
scnprintf implementation of kernel guarantees that its result is
terminated with null byte if size is larger than 0. So we don't need
to set terminated-null again.
Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
---
drivers/misc/lkdtm/core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/misc/lkdtm/core.c b/drivers/misc/lkdtm/core.c
index ee0d6e7..5ad2630 100644
--- a/drivers/misc/lkdtm/core.c
+++ b/drivers/misc/lkdtm/core.c
@@ -341,7 +341,6 @@ static ssize_t lkdtm_debugfs_read(struct file *f, char __user *user_buf,
n += scnprintf(buf + n, PAGE_SIZE - n, "%s\n",
crashtypes[i].name);
}
- buf[n] = '\0';
out = simple_read_from_buffer(user_buf, count, off,
buf, n);
--
2.7.4
reply other threads:[~2020-01-19 12:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200119123659.29950-1-chenzhou10@huawei.com \
--to=chenzhou10@huawei.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®