[PATCH] x86: fix missing declartion of init_fs

Zhang Kunbo posted 1 patch 1 year, 2 months ago
fs/fs_struct.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] x86: fix missing declartion of init_fs
Posted by Zhang Kunbo 1 year, 2 months ago
fs/fs_struct.c should include include/linux/init_task.h
 for declaration of init_fs. This fix the sparse warning:

fs/fs_struct.c:163:18: warning: symbol 'init_fs' was not declared. Should it be static?

Signed-off-by: Zhang Kunbo <zhangkunbo@huawei.com>
---
 fs/fs_struct.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/fs_struct.c b/fs/fs_struct.c
index 64c2d0814ed6..100bd3474476 100644
--- a/fs/fs_struct.c
+++ b/fs/fs_struct.c
@@ -6,6 +6,7 @@
 #include <linux/path.h>
 #include <linux/slab.h>
 #include <linux/fs_struct.h>
+#include <linux/init_task.h>
 #include "internal.h"
 
 /*
-- 
2.34.1
Re: [PATCH] x86: fix missing declartion of init_fs
Posted by Markus Elfring 1 year, 2 months ago
> fs/fs_struct.c should include include/linux/init_task.h
>  for declaration of init_fs. This fix the sparse warning:
…

Please avoid a typo in the summary phrase accordingly.


See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.12#n94

Regards,
Markus