mm/filemap: Fix warning: no previous prototype
Subsystems (2)
PATCH 1/1 mm/filemap: Fix warning: no previous prototype
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]
--- mm/filemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/filemap.c +1 -1
@@ -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)
Signature · 1 line
2.23.0
Matthew Wilcox
maintainerQuoted 3 lines · Xiangyang Yu
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.
Quoted 7 lines · Matthew Wilcox
Quoted 3 lines · Xiangyang Yu
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.
Quoted 1 line
Andrew Morton
maintainerQuoted 7 lines · On Fri, 18 Dec 2020 09:39:30 +0530 Souptick Joarder <[email protected]>…
Quoted 6 lines · Matthew Wilcox
Quoted 3 lines · Xiangyang Yu
Fixed the warning when building with warnings enabled (W=1), This function is only used in
filemap.c, so mark this function with 'static'.
Quoted 7 lines
Quoted 1 line
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 commit3351b16af494("mm/filemap: add static for function__add_to_page_cache_locked") due to incompatibility withALLOW_ERROR_INJECTIONwhich 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?
Quoted 12 lines · Andrew Morton
Quoted 9 lines · On Fri, 18 Dec 2020 09:39:30 +0530 Souptick Joarder <[email protected]>…
Quoted 7 lines · Matthew Wilcox
Quoted 3 lines · Xiangyang Yu
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.
Quoted 9 lines
Quoted 5 lines
revert "mm/filemap: add static for function
__add_to_page_cache_locked" Revert commit3351b16af494("mm/filemap: add static for function__add_to_page_cache_locked") due to incompatibility withALLOW_ERROR_INJECTIONwhich 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.