[PATCH] afs: fix no return warning in afs_dir_dirty_folio

zhangshida starzhangzsd at gmail.com
Mon Jul 10 19:59:02 PDT 2023


From: Shida Zhang <zhangshida at kylinos.cn>

Quiet down this gcc warning generated by
mips-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110:

../fs/afs/dir.c: In function ‘afs_dir_dirty_folio’:
../fs/afs/dir.c:52:1: error: no return statement in function returning non-void [-Werror=return-type]
   52 | }
      | ^
cc1: all warnings being treated as errors

>From code analysis I don't think this is a real problem, but unheeded
warnings just beget more warnings, and you end up being warning-blind.

Reported-by: k2ci <kernel-bot at kylinos.cn>
Signed-off-by: Shida Zhang <zhangshida at kylinos.cn>
---
 fs/afs/dir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 5219182e52e1..34b22873afff 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -49,6 +49,7 @@ static bool afs_dir_dirty_folio(struct address_space *mapping,
 		struct folio *folio)
 {
 	BUG(); /* This should never happen. */
+	return true;
 }
 
 const struct file_operations afs_dir_file_operations = {
-- 
2.27.0




More information about the linux-afs mailing list