aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-07-28 18:48:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-28 19:07:41 -0400
commit11db04864336f20e19e16b64ade781eeefc3f6d3 (patch)
tree2064660589094379ad6586969e6a3a39b328555e
parentc02b6aec6dbf0482999090709ab75f99d060a097 (diff)
mm: cleanup ifdef guards for vmem_altmap
Now that ZONE_DEVICE depends on SPARSEMEM_VMEMMAP we can simplify some ifdef guards to just ZONE_DEVICE. Link: http://lkml.kernel.org/r/146687646788.39261.8020536391978771940.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com> Reported-by: Vlastimil Babka <vbabka@suse.cz> Cc: Eric Sandeen <sandeen@redhat.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/memremap.h2
-rw-r--r--kernel/memremap.c8
2 files changed, 1 insertions, 9 deletions
diff --git a/include/linux/memremap.h b/include/linux/memremap.h
index bcaa634139a9..93416196ba64 100644
--- a/include/linux/memremap.h
+++ b/include/linux/memremap.h
@@ -26,7 +26,7 @@ struct vmem_altmap {
26unsigned long vmem_altmap_offset(struct vmem_altmap *altmap); 26unsigned long vmem_altmap_offset(struct vmem_altmap *altmap);
27void vmem_altmap_free(struct vmem_altmap *altmap, unsigned long nr_pfns); 27void vmem_altmap_free(struct vmem_altmap *altmap, unsigned long nr_pfns);
28 28
29#if defined(CONFIG_SPARSEMEM_VMEMMAP) && defined(CONFIG_ZONE_DEVICE) 29#ifdef CONFIG_ZONE_DEVICE
30struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start); 30struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start);
31#else 31#else
32static inline struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start) 32static inline struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start)
diff --git a/kernel/memremap.c b/kernel/memremap.c
index 017532193fb1..ddb3247a872a 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -308,12 +308,6 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
308 if (is_ram == REGION_INTERSECTS) 308 if (is_ram == REGION_INTERSECTS)
309 return __va(res->start); 309 return __va(res->start);
310 310
311 if (altmap && !IS_ENABLED(CONFIG_SPARSEMEM_VMEMMAP)) {
312 dev_err(dev, "%s: altmap requires CONFIG_SPARSEMEM_VMEMMAP=y\n",
313 __func__);
314 return ERR_PTR(-ENXIO);
315 }
316
317 if (!ref) 311 if (!ref)
318 return ERR_PTR(-EINVAL); 312 return ERR_PTR(-EINVAL);
319 313
@@ -401,7 +395,6 @@ void vmem_altmap_free(struct vmem_altmap *altmap, unsigned long nr_pfns)
401 altmap->alloc -= nr_pfns; 395 altmap->alloc -= nr_pfns;
402} 396}
403 397
404#ifdef CONFIG_SPARSEMEM_VMEMMAP
405struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start) 398struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start)
406{ 399{
407 /* 400 /*
@@ -427,5 +420,4 @@ struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start)
427 420
428 return pgmap ? pgmap->altmap : NULL; 421 return pgmap ? pgmap->altmap : NULL;
429} 422}
430#endif /* CONFIG_SPARSEMEM_VMEMMAP */
431#endif /* CONFIG_ZONE_DEVICE */ 423#endif /* CONFIG_ZONE_DEVICE */