Skip to contentSkip to conversation

kernel: reboot: Remove unnecessary ‘0’ values from ret

PATCH In review Li zeming 2 participants 2 messages Jul 10, 2023

lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 kernel: reboot: Remove unnecessary ‘0’ values from ret

ret is assigned first, so it does not need to initialize the assignment.

---
 kernel/reboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/reboot.c +1 -1
index 3bba88c7ffc6..e00a02a74694 100644
@@ -702,7 +702,7 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
 {
 	struct pid_namespace *pid_ns = task_active_pid_ns(current);
 	char buffer[256];
-	int ret = 0;
+	int ret;
 
 	/* We only trust the superuser with rebooting the system. */
 	if (!ns_capable(pid_ns->user_ns, CAP_SYS_BOOT))
Signature · 1 line
2.18.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Li zeming

ret is assigned first, so it does not need to initialize the assignment.

Thanks.

Quoted 17 lines
---
 kernel/reboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/reboot.c +1 -1
index 3bba88c7ffc6..e00a02a74694 100644
@@ -702,7 +702,7 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
 {
 	struct pid_namespace *pid_ns = task_active_pid_ns(current);
 	char buffer[256];
-	int ret = 0;
+	int ret;
 
 	/* We only trust the superuser with rebooting the system. */
 	if (!ns_capable(pid_ns->user_ns, CAP_SYS_BOOT))
Signature · 1 line
~Randy