[PATCH 03/14] mm/page_alloc: Make should_fail_alloc_page a static function should_fail_alloc_page static

From
Mel Gorman <hidden>
Date
2021-05-20 08:48:59
Also in
lkml
Reply to
Mel Gorman, 2021-05-20
make W=1 generates the following warning for mm/page_alloc.c

  mm/page_alloc.c:3651:15: warning: no previous prototype for ‘should_fail_alloc_page’ [-Wmissing-prototypes]
   noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
                 ^~~~~~~~~~~~~~~~~~~~~~

This function is deliberately split out for BPF to allow errors to be
injected. The function is not used anywhere else so it is local to
the file. Make it static which should still allow error injection
to be used similar to how block/blk-core.c:should_fail_bio() works.

Signed-off-by: Mel Gorman <redacted>
---
 mm/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index aaa1655cf682..26cc1a4e639b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3648,7 +3648,7 @@ static inline bool __should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
 
 #endif /* CONFIG_FAIL_PAGE_ALLOC */
 
-noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
+static noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
 {
 	return __should_fail_alloc_page(gfp_mask, order);
 }
-- 
2.26.2

Thread (23 messages) 23 messages, 6 authors, last reply 2021-07-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help