Skip to contentSkip to conversation

proc/fd: Remove the initialization of variables in seq_show()

PATCH New Kaitao Cheng 1 participant 1 message May 23, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 proc/fd: Remove the initialization of variables in seq_show()

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

---
 fs/proc/fd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/proc/fd.c +2 -2
index 81882a13212d..6f95baf44e37 100644
@@ -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);
Signature · 1 line
2.20.1