When assign (struct *) pointer to (struct __rcu *) variable,
Sparse warns:
"incorrect type in initializer (different address spaces)".
Force casting to (struct __ruc *) pointer to fix it.
Signed-off-by: liqiong <[email protected]>
---
init/init_task.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/init/init_task.c b/init/init_task.c
index 73cc8f03511a..ba8ff3051cd2 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -104,8 +104,8 @@ struct task_struct init_task
#endif
.ptraced = LIST_HEAD_INIT(init_task.ptraced),
.ptrace_entry = LIST_HEAD_INIT(init_task.ptrace_entry),
- .real_parent = &init_task,
- .parent = &init_task,
+ .real_parent = (struct task_struct __rcu *)&init_task,
+ .parent = (struct task_struct __rcu *)&init_task,
.children = LIST_HEAD_INIT(init_task.children),
.sibling = LIST_HEAD_INIT(init_task.sibling),
.group_leader = &init_task,
@@ -119,7 +119,7 @@ struct task_struct init_task
.io_uring = NULL,
#endif
.signal = &init_signals,
- .sighand = &init_sighand,
+ .sighand = (struct sighand_struct __rcu *)&init_sighand,
.nsproxy = &init_nsproxy,
.pending = {
.list = LIST_HEAD_INIT(init_task.pending.list),
--
2.25.1