Skip to content

Commit b41ca5d

Browse files
Tashar02RealJohnGalt
authored andcommitted
mm: Tidy up pcp lists checks usage
check_pcp_refill() remains the same with and without CONFIG_DEBUG_VM enabled. Remove the unnecesary guard and keep the functions inlined alongside making use of ternary operator at check_new_pcp() to choose the return value conditionally to achieve better code readability without compromising any functionality. Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
1 parent 6af4c86 commit b41ca5d

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

mm/page_alloc.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,26 +1808,15 @@ static inline bool free_pages_prezeroed(void)
18081808
page_poisoning_enabled()) || want_init_on_free();
18091809
}
18101810

1811-
#ifdef CONFIG_DEBUG_VM
1812-
static bool check_pcp_refill(struct page *page)
1813-
{
1814-
return false;
1815-
}
1816-
1817-
static bool check_new_pcp(struct page *page)
1818-
{
1819-
return check_new_page(page);
1820-
}
1821-
#else
18221811
static inline bool check_pcp_refill(struct page *page)
18231812
{
18241813
return false;
18251814
}
1815+
18261816
static inline bool check_new_pcp(struct page *page)
18271817
{
1828-
return false;
1818+
return IS_ENABLED(CONFIG_DEBUG_VM) ? check_new_page(page) : false;
18291819
}
1830-
#endif /* CONFIG_DEBUG_VM */
18311820

18321821
static bool check_new_pages(struct page *page, unsigned int order)
18331822
{

0 commit comments

Comments
 (0)