[PATCH] fork: remove #ifdef CONFIG_LOCKDEP in copy_process()

From: Tio Zhang
Date: Wed Aug 20 2025 - 06:19:41 EST


lockdep_init_task() is defined as an empty when
CONFIG_LOCKDEP is not set.
So the #ifdef here is redundant, remove it.

Signed-off-by: Tio Zhang <tiozhang@xxxxxxxxxxxxxx>
---
kernel/fork.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index af673856499d..e06cfaa85a84 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2124,9 +2124,7 @@ __latent_entropy struct task_struct *copy_process(

p->pagefault_disabled = 0;

-#ifdef CONFIG_LOCKDEP
lockdep_init_task(p);
-#endif

p->blocked_on = NULL; /* not blocked yet */

--
2.39.3 (Apple Git-145)