mm/zonelist: enumerate zonelists array index
Hardcoding index to zonelists array in gfp_zonelist() is not a good idea, let's enumerate it to improve readability. No functional change. [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: fix CONFIG_NUMA=n build] [n-horiguchi@ah.jp.nec.com: fix warning in comparing enumerator] Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com> Cc: Michal Hocko <mhocko@kernel.org> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
06640290bf
commit
c00eb15a89
@@ -384,10 +384,11 @@ static inline enum zone_type gfp_zone(gfp_t flags)
|
||||
|
||||
static inline int gfp_zonelist(gfp_t flags)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_NUMA) && unlikely(flags & __GFP_THISNODE))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
#ifdef CONFIG_NUMA
|
||||
if (unlikely(flags & __GFP_THISNODE))
|
||||
return ZONELIST_NOFALLBACK;
|
||||
#endif
|
||||
return ZONELIST_FALLBACK;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user