Skip to contentSkip to conversation

Kernel: Fixed two bracket problems in fork.c

PATCH In review Alexander Guril 2 participants 2 messages Dec 21, 2020

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

PATCH 1/1 Kernel: Fixed two bracket problems in fork.c

This fixes two bracket problems in kernel/fork.c

---
 kernel/fork.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
kernel/fork.c +2 -4
index 41906a52a764..3a5301867297 100644
@@ -819,9 +819,8 @@ void __init fork_init(void)
 	init_task.signal->rlim[RLIMIT_SIGPENDING] =
 		init_task.signal->rlim[RLIMIT_NPROC];
 
-	for (i = 0; i < UCOUNT_COUNTS; i++) {
+	for (i = 0; i < UCOUNT_COUNTS; i++)
 		init_user_ns.ucount_max[i] = max_threads/2;
-	}
 
 #ifdef CONFIG_VMAP_STACK
 	cpuhp_setup_state(CPUHP_BP_PREPARE_DYN, "fork:vm_stack_cache",
@@ -1654,9 +1653,8 @@ static inline void init_task_pid_links(struct task_struct *task)
 {
 	enum pid_type type;
 
-	for (type = PIDTYPE_PID; type < PIDTYPE_MAX; ++type) {
+	for (type = PIDTYPE_PID; type < PIDTYPE_MAX; ++type)
 		INIT_HLIST_NODE(&task->pid_links[type]);
-	}
 }
 
 static inline void
Signature · 1 line
2.29.2
#1 lore raw
Quoted 4 lines · Alexander Guril

This fixes two bracket problems in kernel/fork.c

---

Thanks for the patch.
Unfortunately, there's no real rationale for the change in the commit message. You probably want to mention that our coding-style mandates that we don't use {} around single-line statements.

Christian

Quoted 32 lines
 kernel/fork.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
kernel/fork.c +2 -4
index 41906a52a764..3a5301867297 100644
@@ -819,9 +819,8 @@ void __init fork_init(void)
 	init_task.signal->rlim[RLIMIT_SIGPENDING] =
 		init_task.signal->rlim[RLIMIT_NPROC];
 
-	for (i = 0; i < UCOUNT_COUNTS; i++) {
+	for (i = 0; i < UCOUNT_COUNTS; i++)
 		init_user_ns.ucount_max[i] = max_threads/2;
-	}
 
 #ifdef CONFIG_VMAP_STACK
 	cpuhp_setup_state(CPUHP_BP_PREPARE_DYN, "fork:vm_stack_cache",
@@ -1654,9 +1653,8 @@ static inline void init_task_pid_links(struct task_struct *task)
 {
 	enum pid_type type;
 
-	for (type = PIDTYPE_PID; type < PIDTYPE_MAX; ++type) {
+	for (type = PIDTYPE_PID; type < PIDTYPE_MAX; ++type)
 		INIT_HLIST_NODE(&task->pid_links[type]);
-	}
 }
 
 static inline void
Signature · 1 line
2.29.2