From: Chengguang Xu <cgxu519@mykernel.net>
To: tytso@mit.edu, adilger.kernel@dilger.ca
Cc: linux-ext4@vger.kernel.org, Chengguang Xu <cgxu519@mykernel.net>
Subject: [PATCH] ext4: remove unnecessary assignment in ext4_htree_store_dirent()
Date: Fri, 6 Dec 2019 13:43:17 +0800 [thread overview]
Message-ID: <20191206054317.3107-1-cgxu519@mykernel.net> (raw)
We have allocated memory using kzalloc() so don't have
to set 0 again in last byte.
Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
---
fs/ext4/dir.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index 9fdd2b269d61..5923c9147ae7 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -458,7 +458,6 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
new_fn->name_len = ent_name->len;
new_fn->file_type = dirent->file_type;
memcpy(new_fn->name, ent_name->name, ent_name->len);
- new_fn->name[ent_name->len] = 0;
while (*p) {
parent = *p;
--
2.20.1
next reply other threads:[~2019-12-06 5:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-06 5:43 Chengguang Xu [this message]
2020-01-13 18:52 ` [PATCH] ext4: remove unnecessary assignment in ext4_htree_store_dirent() Theodore Y. Ts'o
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=20191206054317.3107-1-cgxu519@mykernel.net \
--to=cgxu519@mykernel.net \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).