linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kaitao Cheng <pilgrimtao@gmail.com>
To: adobriyan@gmail.com
Cc: pilgrimtao@gmail.com, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, songmuchun@bytedance.com
Subject: [PATCH] proc/fd: Remove the initialization of variables in seq_show()
Date: Sat, 23 May 2020 23:49:31 +0800	[thread overview]
Message-ID: <20200523154931.29255-1-pilgrimtao@gmail.com> (raw)

The variables{files, file} will definitely be assigned,
so we don't need to initialize them.

Signed-off-by: Kaitao Cheng <pilgrimtao@gmail.com>
---
 fs/proc/fd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/proc/fd.c b/fs/proc/fd.c
index 81882a13212d..6f95baf44e37 100644
--- a/fs/proc/fd.c
+++ b/fs/proc/fd.c
@@ -19,9 +19,9 @@
 
 static int seq_show(struct seq_file *m, void *v)
 {
-	struct files_struct *files = NULL;
+	struct files_struct *files;
 	int f_flags = 0, ret = -ENOENT;
-	struct file *file = NULL;
+	struct file *file;
 	struct task_struct *task;
 
 	task = get_proc_task(m->private);
-- 
2.20.1


             reply	other threads:[~2020-05-23 15:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-23 15:49 Kaitao Cheng [this message]
2020-05-24  7:46 [PATCH] proc/fd: Remove the initialization of variables in seq_show() Markus Elfring
2020-05-28 12:51 ` Tao pilgrim

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=20200523154931.29255-1-pilgrimtao@gmail.com \
    --to=pilgrimtao@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=songmuchun@bytedance.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;
as well as URLs for NNTP newsgroup(s).