* [PATCH] mm/filemap: Fix warning: no previous prototype
@ 2020-12-17 2:03 Xiangyang Yu
2020-12-17 2:23 ` Matthew Wilcox
0 siblings, 1 reply; 7+ messages in thread
From: Xiangyang Yu @ 2020-12-17 2:03 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel
Fixed the warning when building with warnings enabled (W=1),
This function is only used in filemap.c, so mark this function
with 'static'.
mm/filemap.c:830:14: warning: no previous prototype for ‘__add_to_page_cache_locked’ [-Wmissing-prototypes]
Signed-off-by: Xiangyang Yu <yuxiangyang4@huawei.com>
---
mm/filemap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index c178022d7893..edaba5251bec 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -827,7 +827,7 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
}
EXPORT_SYMBOL_GPL(replace_page_cache_page);
-noinline int __add_to_page_cache_locked(struct page *page,
+static noinline int __add_to_page_cache_locked(struct page *page,
struct address_space *mapping,
pgoff_t offset, gfp_t gfp,
void **shadowp)
--
2.23.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/filemap: Fix warning: no previous prototype
2020-12-17 2:03 [PATCH] mm/filemap: Fix warning: no previous prototype Xiangyang Yu
@ 2020-12-17 2:23 ` Matthew Wilcox
2020-12-18 4:09 ` Souptick Joarder
0 siblings, 1 reply; 7+ messages in thread
From: Matthew Wilcox @ 2020-12-17 2:23 UTC (permalink / raw)
To: Xiangyang Yu; +Cc: akpm, linux-mm, linux-kernel
On Thu, Dec 17, 2020 at 10:03:11AM +0800, Xiangyang Yu wrote:
> Fixed the warning when building with warnings enabled (W=1),
> This function is only used in filemap.c, so mark this function
> with 'static'.
Good grief, no. Look at the git history before proposing a patch.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/filemap: Fix warning: no previous prototype
2020-12-17 2:23 ` Matthew Wilcox
@ 2020-12-18 4:09 ` Souptick Joarder
0 siblings, 0 replies; 7+ messages in thread
From: Souptick Joarder @ 2020-12-18 4:09 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Xiangyang Yu, Andrew Morton, Linux-MM, linux-kernel
On Thu, Dec 17, 2020 at 7:53 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Thu, Dec 17, 2020 at 10:03:11AM +0800, Xiangyang Yu wrote:
> > Fixed the warning when building with warnings enabled (W=1),
> > This function is only used in filemap.c, so mark this function
> > with 'static'.
>
> Good grief, no. Look at the git history before proposing a patch.
revert "mm/filemap: add static for function __add_to_page_cache_locked"
Revert commit 3351b16af494 ("mm/filemap: add static for function
__add_to_page_cache_locked") due to incompatibility with
ALLOW_ERROR_INJECTION which result in build errors.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/filemap: Fix warning: no previous prototype
@ 2020-12-18 4:09 ` Souptick Joarder
0 siblings, 0 replies; 7+ messages in thread
From: Souptick Joarder @ 2020-12-18 4:09 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Xiangyang Yu, Andrew Morton, Linux-MM, linux-kernel
On Thu, Dec 17, 2020 at 7:53 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Thu, Dec 17, 2020 at 10:03:11AM +0800, Xiangyang Yu wrote:
> > Fixed the warning when building with warnings enabled (W=1),
> > This function is only used in filemap.c, so mark this function
> > with 'static'.
>
> Good grief, no. Look at the git history before proposing a patch.
revert "mm/filemap: add static for function __add_to_page_cache_locked"
Revert commit 3351b16af494 ("mm/filemap: add static for function
__add_to_page_cache_locked") due to incompatibility with
ALLOW_ERROR_INJECTION which result in build errors.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/filemap: Fix warning: no previous prototype
2020-12-18 4:09 ` Souptick Joarder
(?)
@ 2020-12-18 17:57 ` Andrew Morton
2020-12-21 19:36 ` Souptick Joarder
-1 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2020-12-18 17:57 UTC (permalink / raw)
To: Souptick Joarder; +Cc: Matthew Wilcox, Xiangyang Yu, Linux-MM, linux-kernel
On Fri, 18 Dec 2020 09:39:30 +0530 Souptick Joarder <jrdr.linux@gmail.com> wrote:
> On Thu, Dec 17, 2020 at 7:53 AM Matthew Wilcox <willy@infradead.org> wrote:
> >
> > On Thu, Dec 17, 2020 at 10:03:11AM +0800, Xiangyang Yu wrote:
> > > Fixed the warning when building with warnings enabled (W=1),
> > > This function is only used in filemap.c, so mark this function
> > > with 'static'.
> >
> > Good grief, no. Look at the git history before proposing a patch.
>
> revert "mm/filemap: add static for function __add_to_page_cache_locked"
> Revert commit 3351b16af494 ("mm/filemap: add static for function
> __add_to_page_cache_locked") due to incompatibility with
> ALLOW_ERROR_INJECTION which result in build errors.
>
How about we add a prototype for __add_to_page_cache_locked() to squash
the warning, along with a comment explaining what's going on?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/filemap: Fix warning: no previous prototype
2020-12-18 17:57 ` Andrew Morton
@ 2020-12-21 19:36 ` Souptick Joarder
0 siblings, 0 replies; 7+ messages in thread
From: Souptick Joarder @ 2020-12-21 19:36 UTC (permalink / raw)
To: Andrew Morton; +Cc: Matthew Wilcox, Xiangyang Yu, Linux-MM, linux-kernel
On Fri, Dec 18, 2020 at 11:27 PM Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> On Fri, 18 Dec 2020 09:39:30 +0530 Souptick Joarder <jrdr.linux@gmail.com> wrote:
>
> > On Thu, Dec 17, 2020 at 7:53 AM Matthew Wilcox <willy@infradead.org> wrote:
> > >
> > > On Thu, Dec 17, 2020 at 10:03:11AM +0800, Xiangyang Yu wrote:
> > > > Fixed the warning when building with warnings enabled (W=1),
> > > > This function is only used in filemap.c, so mark this function
> > > > with 'static'.
> > >
> > > Good grief, no. Look at the git history before proposing a patch.
> >
> > revert "mm/filemap: add static for function __add_to_page_cache_locked"
> > Revert commit 3351b16af494 ("mm/filemap: add static for function
> > __add_to_page_cache_locked") due to incompatibility with
> > ALLOW_ERROR_INJECTION which result in build errors.
> >
>
> How about we add a prototype for __add_to_page_cache_locked() to squash
> the warning, along with a comment explaining what's going on?
>
I think adding a prototype will silence some kernel test robot warning
and future efforts to make it static. I will post a patch.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/filemap: Fix warning: no previous prototype
@ 2020-12-21 19:36 ` Souptick Joarder
0 siblings, 0 replies; 7+ messages in thread
From: Souptick Joarder @ 2020-12-21 19:36 UTC (permalink / raw)
To: Andrew Morton; +Cc: Matthew Wilcox, Xiangyang Yu, Linux-MM, linux-kernel
On Fri, Dec 18, 2020 at 11:27 PM Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> On Fri, 18 Dec 2020 09:39:30 +0530 Souptick Joarder <jrdr.linux@gmail.com> wrote:
>
> > On Thu, Dec 17, 2020 at 7:53 AM Matthew Wilcox <willy@infradead.org> wrote:
> > >
> > > On Thu, Dec 17, 2020 at 10:03:11AM +0800, Xiangyang Yu wrote:
> > > > Fixed the warning when building with warnings enabled (W=1),
> > > > This function is only used in filemap.c, so mark this function
> > > > with 'static'.
> > >
> > > Good grief, no. Look at the git history before proposing a patch.
> >
> > revert "mm/filemap: add static for function __add_to_page_cache_locked"
> > Revert commit 3351b16af494 ("mm/filemap: add static for function
> > __add_to_page_cache_locked") due to incompatibility with
> > ALLOW_ERROR_INJECTION which result in build errors.
> >
>
> How about we add a prototype for __add_to_page_cache_locked() to squash
> the warning, along with a comment explaining what's going on?
>
I think adding a prototype will silence some kernel test robot warning
and future efforts to make it static. I will post a patch.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-12-21 19:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 2:03 [PATCH] mm/filemap: Fix warning: no previous prototype Xiangyang Yu
2020-12-17 2:23 ` Matthew Wilcox
2020-12-18 4:09 ` Souptick Joarder
2020-12-18 4:09 ` Souptick Joarder
2020-12-18 17:57 ` Andrew Morton
2020-12-21 19:36 ` Souptick Joarder
2020-12-21 19:36 ` Souptick Joarder
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.