All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs: fix -Wmissing-declaration warning
@ 2022-03-23 10:00 Enze Li
  0 siblings, 0 replies; only message in thread
From: Enze Li @ 2022-03-23 10:00 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel

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.

Signed-off-by: Enze Li <lienze@kylinos.cn>
---
 fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namei.c b/fs/namei.c
index 44c366f3152f..fe3525807361 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-23 10:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-23 10:00 [PATCH] fs: fix -Wmissing-declaration warning Enze Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.