Skip to content

Commit 878a8e1

Browse files
Dr. David Alan Gilbertweiny2
authored andcommitted
libnvdimm: Remove unused nd_region_conflict
nd_region_conflict() has been unused since 2019's commit a361919 ("libnvdimm/pfn: stop padding pmem namespaces to section alignment") Remove it, and the region_confict() helper it uses, and the associated struct conflict_context. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Link: https://patch.msgid.link/20250220004538.84585-2-linux@treblig.org Signed-off-by: Ira Weiny <ira.weiny@intel.com>
1 parent 2ff0e40 commit 878a8e1

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

drivers/nvdimm/nd-core.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ resource_size_t nd_region_allocatable_dpa(struct nd_region *nd_region);
127127
resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region,
128128
struct nd_mapping *nd_mapping);
129129
resource_size_t nd_region_available_dpa(struct nd_region *nd_region);
130-
int nd_region_conflict(struct nd_region *nd_region, resource_size_t start,
131-
resource_size_t size);
132130
resource_size_t nvdimm_allocated_dpa(struct nvdimm_drvdata *ndd,
133131
struct nd_label_id *label_id);
134132
int nvdimm_num_label_slots(struct nvdimm_drvdata *ndd);

drivers/nvdimm/region_devs.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,45 +1229,4 @@ bool is_nvdimm_sync(struct nd_region *nd_region)
12291229
}
12301230
EXPORT_SYMBOL_GPL(is_nvdimm_sync);
12311231

1232-
struct conflict_context {
1233-
struct nd_region *nd_region;
1234-
resource_size_t start, size;
1235-
};
1236-
1237-
static int region_conflict(struct device *dev, void *data)
1238-
{
1239-
struct nd_region *nd_region;
1240-
struct conflict_context *ctx = data;
1241-
resource_size_t res_end, region_end, region_start;
1242-
1243-
if (!is_memory(dev))
1244-
return 0;
1245-
1246-
nd_region = to_nd_region(dev);
1247-
if (nd_region == ctx->nd_region)
1248-
return 0;
1249-
1250-
res_end = ctx->start + ctx->size;
1251-
region_start = nd_region->ndr_start;
1252-
region_end = region_start + nd_region->ndr_size;
1253-
if (ctx->start >= region_start && ctx->start < region_end)
1254-
return -EBUSY;
1255-
if (res_end > region_start && res_end <= region_end)
1256-
return -EBUSY;
1257-
return 0;
1258-
}
1259-
1260-
int nd_region_conflict(struct nd_region *nd_region, resource_size_t start,
1261-
resource_size_t size)
1262-
{
1263-
struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev);
1264-
struct conflict_context ctx = {
1265-
.nd_region = nd_region,
1266-
.start = start,
1267-
.size = size,
1268-
};
1269-
1270-
return device_for_each_child(&nvdimm_bus->dev, &ctx, region_conflict);
1271-
}
1272-
12731232
MODULE_IMPORT_NS("DEVMEM");

0 commit comments

Comments
 (0)