lkml.org 
[lkml]   [2021]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] afs: add a return to afs_dir_set_page_dirty()
Date
From: Tom Rix <trix@redhat.com>

With gcc 10.3, this compile error is reported
dir.c: In function 'afs_dir_set_page_dirty':
dir.c:51:1: error: no return statement in function
returning non-void [-Werror=return-type]

Even though the code is unreachable, add a return
to silence the error.

Signed-off-by: Tom Rix <trix@redhat.com>
---
fs/afs/dir.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 78719f2f567e..988766f88d8b 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -48,6 +48,7 @@ static void afs_dir_invalidatepage(struct page *page, unsigned int offset,
static int afs_dir_set_page_dirty(struct page *page)
{
BUG(); /* This should never happen. */
+ return -EINVAL;
}

const struct file_operations afs_dir_file_operations = {
--
2.26.3
\
 
 \ /
  Last update: 2021-06-01 16:08    [W:0.050 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site