diff options
author | Christoph Hellwig <hch@lst.de> | 2017-12-29 08:54:03 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2018-01-08 11:46:23 -0800 |
commit | 7003e3b1f64d0195ea9d31aed0b096ad38f3cb54 (patch) | |
tree | ad2b8ba6141e740e4b8df2b8f595b511e7239b1f | |
parent | 0628b8c650718f4dfedfcdc9ed136bf7e394aae7 (diff) | |
download | linux-7003e3b1f64d0195ea9d31aed0b096ad38f3cb54.tar.gz linux-7003e3b1f64d0195ea9d31aed0b096ad38f3cb54.tar.bz2 linux-7003e3b1f64d0195ea9d31aed0b096ad38f3cb54.zip |
memremap: simplify duplicate region handling in devm_memremap_pages
__radix_tree_insert already checks for duplicates and returns -EEXIST in
that case, so remove the duplicate (and racy) duplicates check.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | kernel/memremap.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/kernel/memremap.c b/kernel/memremap.c index b09517439dec..12e78528fea4 100644 --- a/kernel/memremap.c +++ b/kernel/memremap.c @@ -396,17 +396,6 @@ void *devm_memremap_pages(struct device *dev, struct resource *res, align_end = align_start + align_size - 1; foreach_order_pgoff(res, order, pgoff) { - struct dev_pagemap *dup; - - rcu_read_lock(); - dup = find_dev_pagemap(res->start + PFN_PHYS(pgoff)); - rcu_read_unlock(); - if (dup) { - dev_err(dev, "%s: %pr collides with mapping for %s\n", - __func__, res, dev_name(dup->dev)); - error = -EBUSY; - break; - } error = __radix_tree_insert(&pgmap_radix, PHYS_PFN(res->start) + pgoff, order, page_map); if (error) { |