Skip to contentSkip to conversation

connector: fix #include <linux/cn_proc.h>

PATCH In review Alexey Dobriyan 1 participant 1 message Jan 23, 2024

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

PATCH 1/2 connector: fix #include <linux/cn_proc.h>

Including <linux/cn_proc.h> first line doesn't work because of missing forward declaration:

In file included from kernel/foo.c:1:
include/linux/cn_proc.h:32:47: error: ‘struct task_struct’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
32 | static inline void proc_fork_connector(struct task_struct *task)
| ^~~~~~~~~~~

---

 include/linux/cn_proc.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/cn_proc.h +2 -0
@@ -19,6 +19,8 @@
 
 #include <uapi/linux/cn_proc.h>
 
+struct task_struct;
+
 #ifdef CONFIG_PROC_EVENTS
 void proc_fork_connector(struct task_struct *task);
 void proc_exec_connector(struct task_struct *task);