Skip to contentSkip to conversation

fs: fix -Wmissing-declaration warning

PATCH New Enze Li 1 participant 1 message Mar 23, 2022 VFS

lore
Share & tools
lore

Enze Li

author
#0 lore raw

PATCH 1/1 fs: fix -Wmissing-declaration warning

I encontered the following warning when compiling with -Wmissing-declarations:

fs/namei.c:2587:5: warning: no previous declaration for ‘filename_parentat’ [-Wmissing-declarations]
2587 | int filename_parentat(int dfd, struct filename *name, unsigned int flags,

       |     ^~~~~~~~~~~~~~~~~)

This warning was introduced by recent commit 43ff44bde7e5 ("ksmbd: fix racy issue from using ->d_parent and ->d_name").

Address this warning by declaring the function as static, setting its scope to the containing file.

---
 fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/namei.c +1 -1
index 44c366f3152f..fe3525807361 100644
@@ -2584,7 +2584,7 @@ static int __filename_parentat(int dfd, struct filename *name,
 	return retval;
 }
 
-int filename_parentat(int dfd, struct filename *name, unsigned int flags,
+static int filename_parentat(int dfd, struct filename *name, unsigned int flags,
 		      struct path *parent, struct qstr *last, int *type)
 {
 	return __filename_parentat(dfd, name, flags, parent, last, type, NULL);
Signature · 1 line
2.25.1