All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: akpm@linux-foundation.org, broonie@kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, linux-next@vger.kernel.org, mhocko@suse.cz,
	mm-commits@vger.kernel.org, sfr@canb.auug.org.au,
	Dan Williams <dan.j.williams@intel.com>
Subject: [PATCH -mmotm] mm/memory_hotplug: fix for CONFIG_ZONE_DEVICE not enabled
Date: Tue, 19 Jan 2021 19:04:50 -0800	[thread overview]
Message-ID: <5f8e2ede-5836-45e1-d8d7-ae949775e76e@infradead.org> (raw)
In-Reply-To: <20210119213727.pkiuSGW9i%akpm@linux-foundation.org>

From: Randy Dunlap <rdunlap@infradead.org>

Fix memory_hotplug.c when CONFIG_ZONE_DEVICE is not enabled.

Fixes this build error:

../mm/memory_hotplug.c: In function ‘move_pfn_range_to_zone’:
../mm/memory_hotplug.c:772:24: error: ‘ZONE_DEVICE’ undeclared (first use in this function); did you mean ‘ZONE_MOVABLE’?
  if (zone_idx(zone) == ZONE_DEVICE) {

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Williams <dan.j.williams@intel.com>
---
 mm/memory_hotplug.c |    2 ++
 1 file changed, 2 insertions(+)

--- mmotm-2021-0119-1336.orig/mm/memory_hotplug.c
+++ mmotm-2021-0119-1336/mm/memory_hotplug.c
@@ -769,12 +769,14 @@ void __ref move_pfn_range_to_zone(struct
 	 * ZONE_DEVICE pages in an otherwise  ZONE_{NORMAL,MOVABLE}
 	 * section.
 	 */
+#ifdef CONFIG_ZONE_DEVICE
 	if (zone_idx(zone) == ZONE_DEVICE) {
 		if (!IS_ALIGNED(start_pfn, PAGES_PER_SECTION))
 			section_taint_zone_device(start_pfn);
 		if (!IS_ALIGNED(start_pfn + nr_pages, PAGES_PER_SECTION))
 			section_taint_zone_device(start_pfn + nr_pages);
 	}
+#endif
 
 	/*
 	 * TODO now we have a visible range of pages which are not associated


  parent reply	other threads:[~2021-01-20  3:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19 21:37 mmotm 2021-01-19-13-36 uploaded akpm
2021-01-19 22:50 ` mmotm 2021-01-19-13-36 uploaded (ZONE_DEVICE) Randy Dunlap
2021-01-20  3:04 ` Randy Dunlap [this message]
2021-01-20  4:12   ` [PATCH -mmotm] mm/memory_hotplug: fix for CONFIG_ZONE_DEVICE not enabled Dan Williams
2021-01-20  4:12     ` Dan Williams

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=5f8e2ede-5836-45e1-d8d7-ae949775e76e@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=broonie@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=mm-commits@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.