mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Donglin Peng <dolinux.peng@gmail.com>
To: tytso@mit.edu
Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	pengdonglin <pengdonglin@xiaomi.com>
Subject: [PATCH] fs/ext4: Remove unnecessary zero-initialization via memset
Date: Thu, 11 Dec 2025 20:38:29 +0800	[thread overview]
Message-ID: <20251211123829.2777009-1-dolinux.peng@gmail.com> (raw)

From: pengdonglin <pengdonglin@xiaomi.com>

The d_path function does not require the caller to pre-zero the
buffer.

Signed-off-by: pengdonglin <pengdonglin@xiaomi.com>
---
 fs/ext4/file.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 7a8b30932189..484cb7388802 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -858,7 +858,6 @@ static int ext4_sample_last_mounted(struct super_block *sb,
 	 * when trying to sort through large numbers of block
 	 * devices or filesystem images.
 	 */
-	memset(buf, 0, sizeof(buf));
 	path.mnt = mnt;
 	path.dentry = mnt->mnt_root;
 	cp = d_path(&path, buf, sizeof(buf));
-- 
2.34.1


             reply	other threads:[~2025-12-11 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 12:38 Donglin Peng [this message]
2025-12-16  6:12 ` Baokun Li
2025-12-16  7:59 ` Zhang Yi
2026-01-28 18:04 ` Theodore 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=20251211123829.2777009-1-dolinux.peng@gmail.com \
    --to=dolinux.peng@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pengdonglin@xiaomi.com \
    --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

all inboxes | Powered by JetHome®