From: Geliang Tang <geliangtang@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
Mel Gorman <mgorman@techsingularity.net>,
Michal Hocko <mhocko@suse.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Geliang Tang <geliangtang@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mm/page_alloc: use nth_page helper
Date: Fri, 24 Mar 2017 22:10:50 +0800 [thread overview]
Message-ID: <b75be84c34466eb063bd44ee1ff7f2bf085002b2.1490323567.git.geliangtang@gmail.com> (raw)
In-Reply-To: <ab50f7fbf9826ac7275f0513ca04bf1073b41a36.1490323750.git.geliangtang@gmail.com>
Use nth_page() helper instead of page_to_pfn() and pfn_to_page() to
simplify the code.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
mm/page_alloc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index f749b7f..3354f56 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2511,9 +2511,8 @@ void mark_free_pages(struct zone *zone)
&zone->free_area[order].free_list[t], lru) {
unsigned long i;
- pfn = page_to_pfn(page);
for (i = 0; i < (1UL << order); i++)
- swsusp_set_page_free(pfn_to_page(pfn + i));
+ swsusp_set_page_free(nth_page(page, i));
}
}
spin_unlock_irqrestore(&zone->lock, flags);
--
2.9.3
next prev parent reply other threads:[~2017-03-24 14:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-24 14:10 [PATCH] drivers: base: dma-mapping: " Geliang Tang
2017-03-24 14:10 ` Geliang Tang [this message]
2017-03-24 17:43 ` [PATCH] mm/page_alloc: " Vlastimil Babka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b75be84c34466eb063bd44ee1ff7f2bf085002b2.1490323567.git.geliangtang@gmail.com \
--to=geliangtang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®