[PATCH] afs: fix a compilation issue

oushixiong posted 1 patch 2 years, 8 months ago
fs/afs/dir.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] afs: fix a compilation issue
Posted by oushixiong 2 years, 8 months ago
fix a compilation issue:
error: no return statement in function returning non-void

Reported-by: k2ci <kernel-bot@kylinos.cn>
Signed-off-by: oushixiong <oushixiong@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 b7c1f8c84b38..0522fb61b929 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 false;
 }
 
 const struct file_operations afs_dir_file_operations = {
-- 
2.25.1
Re: [PATCH] afs: fix a compilation issue
Posted by David Howells 2 years, 8 months ago
oushixiong <oushixiong@kylinos.cn> wrote:

>  	BUG(); /* This should never happen. */
> +	return false;

This isn't necessary.  BUG() should be no-return.

David