summaryrefslogtreecommitdiff
path: root/mm/util.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2019-09-24 01:34:30 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-25 01:54:08 +0300
commitd8c6546b1aea843fbeb4d54a1202f1adda6504be (patch)
tree4b0fcc4a1afc9342472d59293b50fce20f2d70e7 /mm/util.c
parent94ad9338109fe9d0b8a4a16828719dd6dcaee4c2 (diff)
downloadlinux-d8c6546b1aea843fbeb4d54a1202f1adda6504be.tar.xz
mm: introduce compound_nr()
Replace 1 << compound_order(page) with compound_nr(page). Minor improvements in readability. Link: http://lkml.kernel.org/r/20190721104612.19120-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Michal Hocko <mhocko@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/util.c')
-rw-r--r--mm/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/util.c b/mm/util.c
index e6351a80f248..bab284d69c8c 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -521,7 +521,7 @@ bool page_mapped(struct page *page)
return true;
if (PageHuge(page))
return false;
- for (i = 0; i < (1 << compound_order(page)); i++) {
+ for (i = 0; i < compound_nr(page); i++) {
if (atomic_read(&page[i]._mapcount) >= 0)
return true;
}