Skip to content

Commit 31ca72f

Browse files
Charan Teja Kallatorvalds
authored andcommitted
mm: compaction: fix compiler warning when CONFIG_COMPACTION=n
The below warning is reported when CONFIG_COMPACTION=n: mm/compaction.c:56:27: warning: 'HPAGE_FRAG_CHECK_INTERVAL_MSEC' defined but not used [-Wunused-const-variable=] 56 | static const unsigned int HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix it by moving 'HPAGE_FRAG_CHECK_INTERVAL_MSEC' under CONFIG_COMPACTION defconfig. Also since this is just a 'static const int' type, use #define for it. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Charan Teja Kalla <[email protected]> Reported-by: kernel test robot <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Cc: Nitin Gupta <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e914d8f commit 31ca72f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mm/compaction.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
#include "internal.h"
2727

2828
#ifdef CONFIG_COMPACTION
29+
/*
30+
* Fragmentation score check interval for proactive compaction purposes.
31+
*/
32+
#define HPAGE_FRAG_CHECK_INTERVAL_MSEC (500)
33+
2934
static inline void count_compact_event(enum vm_event_item item)
3035
{
3136
count_vm_event(item);
@@ -50,11 +55,6 @@ static inline void count_compact_events(enum vm_event_item item, long delta)
5055
#define pageblock_start_pfn(pfn) block_start_pfn(pfn, pageblock_order)
5156
#define pageblock_end_pfn(pfn) block_end_pfn(pfn, pageblock_order)
5257

53-
/*
54-
* Fragmentation score check interval for proactive compaction purposes.
55-
*/
56-
static const unsigned int HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500;
57-
5858
/*
5959
* Page order with-respect-to which proactive compaction
6060
* calculates external fragmentation, which is used as

0 commit comments

Comments
 (0)