afs: add a return to afs_dir_set_page_dirty()
PATCH 1/1 afs: add a return to afs_dir_set_page_dirty()
From: Tom Rix <[email protected]>
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 <[email protected]>
--- fs/afs/dir.c | 1 + 1 file changed, 1 insertion(+)
fs/afs/dir.c +1 -0
@@ -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 = {
Signature · 1 line
2.26.3
Quoted 11 lines · On 6/1/21 7:08 AM, [email protected] wrote:
From: Tom Rix <[email protected]>
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 <[email protected]>
or this previous patch:
https://lore.kernel.org/lkml/[email protected]/
but for either of them, ack.
Acked-by Randy Dunlap <[email protected]>
thanks.
Quoted 17 lines
--- fs/afs/dir.c | 1 + 1 file changed, 1 insertion(+)fs/afs/dir.c +1
-0@@ -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 = {
Signature · 1 line
~Randy