Skip to contentSkip to conversation

proc: proc_sysctl: Optimize proc_sys_fill_cache() variable

PATCH New Li zeming 1 participant 1 message Jan 15, 2024

Subsystems (3)
lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 proc: proc_sysctl: Optimize proc_sys_fill_cache() variable

The ino and type variables are assigned values before use, and they do not need to be assigned values when defined.

---
 fs/proc/proc_sysctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/proc/proc_sysctl.c +2 -2
index c88854df0b624..cdda684551599 100644
@@ -683,8 +683,8 @@ static bool proc_sys_fill_cache(struct file *file,
 	struct dentry *child, *dir = file->f_path.dentry;
 	struct inode *inode;
 	struct qstr qname;
-	ino_t ino = 0;
-	unsigned type = DT_UNKNOWN;
+	ino_t ino;
+	unsigned type;
 
 	qname.name = table->procname;
 	qname.len  = strlen(table->procname);
Signature · 1 line
2.18.2