* [PATCH] afs: add a return to afs_dir_set_page_dirty()
@ 2021-06-01 14:08 trix
2021-06-01 19:10 ` Randy Dunlap
0 siblings, 1 reply; 2+ messages in thread
From: trix @ 2021-06-01 14:08 UTC (permalink / raw)
To: dhowells, marc.dionne; +Cc: linux-afs, linux-kernel, Tom Rix
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] afs: add a return to afs_dir_set_page_dirty()
2021-06-01 14:08 [PATCH] afs: add a return to afs_dir_set_page_dirty() trix
@ 2021-06-01 19:10 ` Randy Dunlap
0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2021-06-01 19:10 UTC (permalink / raw)
To: trix, dhowells, marc.dionne; +Cc: linux-afs, linux-kernel
On 6/1/21 7:08 AM, trix@redhat.com wrote:
> 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>
or this previous patch:
https://lore.kernel.org/lkml/20210327121624.194639-1-zhengzengkai@huawei.com/
but for either of them, ack.
Acked-by: Randy Dunlap <rdunlap@infradead.org>
thanks.
> ---
> 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 = {
>
--
~Randy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-01 19:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 14:08 [PATCH] afs: add a return to afs_dir_set_page_dirty() trix
2021-06-01 19:10 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).