memremap: remove the dev field in struct dev_pagemap

The dev field in struct dev_pagemap is only used to print dev_name in two
places, which are at best nice to have.  Just remove the field and thus
the name in those two messages.

Link: https://lore.kernel.org/r/20190818090557.17853-3-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Tested-by: Bharata B Rao <bharata@linux.ibm.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Christoph Hellwig 2019-08-18 11:05:55 +02:00 committed by Jason Gunthorpe
parent 0c38519039
commit fdc029b19d
4 changed files with 2 additions and 8 deletions

View File

@ -109,7 +109,6 @@ struct dev_pagemap {
struct percpu_ref *ref; struct percpu_ref *ref;
struct percpu_ref internal_ref; struct percpu_ref internal_ref;
struct completion done; struct completion done;
struct device *dev;
enum memory_type type; enum memory_type type;
unsigned int flags; unsigned int flags;
u64 pci_p2pdma_bus_offset; u64 pci_p2pdma_bus_offset;

View File

@ -96,7 +96,6 @@ static void dev_pagemap_cleanup(struct dev_pagemap *pgmap)
static void devm_memremap_pages_release(void *data) static void devm_memremap_pages_release(void *data)
{ {
struct dev_pagemap *pgmap = data; struct dev_pagemap *pgmap = data;
struct device *dev = pgmap->dev;
struct resource *res = &pgmap->res; struct resource *res = &pgmap->res;
unsigned long pfn; unsigned long pfn;
int nid; int nid;
@ -123,8 +122,7 @@ static void devm_memremap_pages_release(void *data)
untrack_pfn(NULL, PHYS_PFN(res->start), resource_size(res)); untrack_pfn(NULL, PHYS_PFN(res->start), resource_size(res));
pgmap_array_delete(res); pgmap_array_delete(res);
dev_WARN_ONCE(dev, pgmap->altmap.alloc, WARN_ONCE(pgmap->altmap.alloc, "failed to free all reserved pages\n");
"%s: failed to free all reserved pages\n", __func__);
} }
static void dev_pagemap_percpu_release(struct percpu_ref *ref) static void dev_pagemap_percpu_release(struct percpu_ref *ref)
@ -245,8 +243,6 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
goto err_array; goto err_array;
} }
pgmap->dev = dev;
error = xa_err(xa_store_range(&pgmap_array, PHYS_PFN(res->start), error = xa_err(xa_store_range(&pgmap_array, PHYS_PFN(res->start),
PHYS_PFN(res->end), pgmap, GFP_KERNEL)); PHYS_PFN(res->end), pgmap, GFP_KERNEL));
if (error) if (error)

View File

@ -5982,7 +5982,7 @@ void __ref memmap_init_zone_device(struct zone *zone,
} }
} }
pr_info("%s initialised, %lu pages in %ums\n", dev_name(pgmap->dev), pr_info("%s initialised %lu pages in %ums\n", __func__,
size, jiffies_to_msecs(jiffies - start)); size, jiffies_to_msecs(jiffies - start));
} }

View File

@ -132,7 +132,6 @@ void *__wrap_devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
if (!nfit_res) if (!nfit_res)
return devm_memremap_pages(dev, pgmap); return devm_memremap_pages(dev, pgmap);
pgmap->dev = dev;
if (!pgmap->ref) { if (!pgmap->ref) {
if (pgmap->ops && (pgmap->ops->kill || pgmap->ops->cleanup)) if (pgmap->ops && (pgmap->ops->kill || pgmap->ops->cleanup))
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);