Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libnvdimm: Remove unused nd_region_conflict

nd_region_conflict() has been unused since 2019's
commit a3619190d62e ("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>

authored by

Dr. David Alan Gilbert and committed by
Ira Weiny
878a8e1e 2ff0e408

-43
-2
drivers/nvdimm/nd-core.h
··· 127 127 resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region, 128 128 struct nd_mapping *nd_mapping); 129 129 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); 132 130 resource_size_t nvdimm_allocated_dpa(struct nvdimm_drvdata *ndd, 133 131 struct nd_label_id *label_id); 134 132 int nvdimm_num_label_slots(struct nvdimm_drvdata *ndd);
-41
drivers/nvdimm/region_devs.c
··· 1229 1229 } 1230 1230 EXPORT_SYMBOL_GPL(is_nvdimm_sync); 1231 1231 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 - 1273 1232 MODULE_IMPORT_NS("DEVMEM");