aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorMatthias Kaehlcke <mka@chromium.org>2017-07-06 18:39:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-06 19:24:33 -0400
commitd73d3c9f698c5e474e58acbaba87a1f134772747 (patch)
tree71b68397612562ec45a1a76b454fc417a021dc3b /mm/page_alloc.c
parent40692eb5eea209c2dd55857f44b4e1d7206e91d6 (diff)
mm/page_alloc.c: mark bad_range() and meminit_pfn_in_nid() as __maybe_unused
The functions are not used in some configurations. Adding the attribute fixes the following warnings when building with clang: mm/page_alloc.c:409:19: error: function 'bad_range' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] mm/page_alloc.c:1106:30: error: unused function 'meminit_pfn_in_nid' [-Werror,-Wunused-function] Link: http://lkml.kernel.org/r/20170518182030.165633-1-mka@chromium.org Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e0f138a47548..ceb45a8e1359 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -511,7 +511,7 @@ static int page_is_consistent(struct zone *zone, struct page *page)
511/* 511/*
512 * Temporary debugging check for pages not lying within a given zone. 512 * Temporary debugging check for pages not lying within a given zone.
513 */ 513 */
514static int bad_range(struct zone *zone, struct page *page) 514static int __maybe_unused bad_range(struct zone *zone, struct page *page)
515{ 515{
516 if (page_outside_zone_boundaries(zone, page)) 516 if (page_outside_zone_boundaries(zone, page))
517 return 1; 517 return 1;
@@ -521,7 +521,7 @@ static int bad_range(struct zone *zone, struct page *page)
521 return 0; 521 return 0;
522} 522}
523#else 523#else
524static inline int bad_range(struct zone *zone, struct page *page) 524static inline int __maybe_unused bad_range(struct zone *zone, struct page *page)
525{ 525{
526 return 0; 526 return 0;
527} 527}
@@ -1297,8 +1297,9 @@ int __meminit early_pfn_to_nid(unsigned long pfn)
1297#endif 1297#endif
1298 1298
1299#ifdef CONFIG_NODES_SPAN_OTHER_NODES 1299#ifdef CONFIG_NODES_SPAN_OTHER_NODES
1300static inline bool __meminit meminit_pfn_in_nid(unsigned long pfn, int node, 1300static inline bool __meminit __maybe_unused
1301 struct mminit_pfnnid_cache *state) 1301meminit_pfn_in_nid(unsigned long pfn, int node,
1302 struct mminit_pfnnid_cache *state)
1302{ 1303{
1303 int nid; 1304 int nid;
1304 1305
@@ -1320,8 +1321,9 @@ static inline bool __meminit early_pfn_in_nid(unsigned long pfn, int node)
1320{ 1321{
1321 return true; 1322 return true;
1322} 1323}
1323static inline bool __meminit meminit_pfn_in_nid(unsigned long pfn, int node, 1324static inline bool __meminit __maybe_unused
1324 struct mminit_pfnnid_cache *state) 1325meminit_pfn_in_nid(unsigned long pfn, int node,
1326 struct mminit_pfnnid_cache *state)
1325{ 1327{
1326 return true; 1328 return true;
1327} 1329}