Commit 90a300dc authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull libnvdimm updates from Ira Weiny:

 - updates to deprecated and changed interfaces

 - bug/kdoc fixes

* tag 'libnvdimm-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  libnvdimm: remove kernel-doc warnings:
  testing: nvdimm: make struct class structures constant
  libnvdimm: Annotate struct nd_region with __counted_by
  nd_btt: Make BTT lanes preemptible
  libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value
  dax: refactor deprecated strncpy
parents e5760335 9ea459e4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ static ssize_t do_id_store(struct device_driver *drv, const char *buf,
		if (action == ID_ADD) {
			dax_id = kzalloc(sizeof(*dax_id), GFP_KERNEL);
			if (dax_id) {
				strncpy(dax_id->dev_name, buf, DAX_NAME_LEN);
				strscpy(dax_id->dev_name, buf, DAX_NAME_LEN);
				list_add(&dax_id->list, &dax_drv->ids);
			} else
				rc = -ENOMEM;
+2 −2
Original line number Diff line number Diff line
@@ -257,9 +257,9 @@ static void badblocks_populate(struct badrange *badrange,

/**
 * nvdimm_badblocks_populate() - Convert a list of badranges to badblocks
 * @region: parent region of the range to interrogate
 * @nd_region: parent region of the range to interrogate
 * @bb: badblocks instance to populate
 * @res: resource range to consider
 * @range: resource range to consider
 *
 * The badrange list generated during bus initialization may contain
 * multiple, possibly overlapping physical address ranges.  Compare each
+1 −1
Original line number Diff line number Diff line
@@ -422,7 +422,7 @@ struct nd_region {
	struct nd_interleave_set *nd_set;
	struct nd_percpu_lane __percpu *lane;
	int (*flush)(struct nd_region *nd_region, struct bio *bio);
	struct nd_mapping mapping[];
	struct nd_mapping mapping[] __counted_by(ndr_mappings);
};

static inline bool nsl_validate_nlabel(struct nd_region *nd_region,
+7 −1
Original line number Diff line number Diff line
@@ -30,7 +30,13 @@ static int of_pmem_region_probe(struct platform_device *pdev)
	if (!priv)
		return -ENOMEM;

	priv->bus_desc.provider_name = kstrdup(pdev->name, GFP_KERNEL);
	priv->bus_desc.provider_name = devm_kstrdup(&pdev->dev, pdev->name,
							GFP_KERNEL);
	if (!priv->bus_desc.provider_name) {
		kfree(priv);
		return -ENOMEM;
	}

	priv->bus_desc.module = THIS_MODULE;
	priv->bus_desc.of_node = np;

+5 −5
Original line number Diff line number Diff line
@@ -939,7 +939,8 @@ unsigned int nd_region_acquire_lane(struct nd_region *nd_region)
{
	unsigned int cpu, lane;

	cpu = get_cpu();
	migrate_disable();
	cpu = smp_processor_id();
	if (nd_region->num_lanes < nr_cpu_ids) {
		struct nd_percpu_lane *ndl_lock, *ndl_count;

@@ -958,16 +959,15 @@ EXPORT_SYMBOL(nd_region_acquire_lane);
void nd_region_release_lane(struct nd_region *nd_region, unsigned int lane)
{
	if (nd_region->num_lanes < nr_cpu_ids) {
		unsigned int cpu = get_cpu();
		unsigned int cpu = smp_processor_id();
		struct nd_percpu_lane *ndl_lock, *ndl_count;

		ndl_count = per_cpu_ptr(nd_region->lane, cpu);
		ndl_lock = per_cpu_ptr(nd_region->lane, lane);
		if (--ndl_count->count == 0)
			spin_unlock(&ndl_lock->lock);
		put_cpu();
	}
	put_cpu();
	migrate_enable();
}
EXPORT_SYMBOL(nd_region_release_lane);

@@ -1028,6 +1028,7 @@ static struct nd_region *nd_region_create(struct nvdimm_bus *nvdimm_bus,

	if (!nd_region)
		return NULL;
	nd_region->ndr_mappings = ndr_desc->num_mappings;
	/* CXL pre-assigns memregion ids before creating nvdimm regions */
	if (test_bit(ND_REGION_CXL, &ndr_desc->flags)) {
		nd_region->id = ndr_desc->memregion;
@@ -1062,7 +1063,6 @@ static struct nd_region *nd_region_create(struct nvdimm_bus *nvdimm_bus,

		get_device(&nvdimm->dev);
	}
	nd_region->ndr_mappings = ndr_desc->num_mappings;
	nd_region->provider_data = ndr_desc->provider_data;
	nd_region->nd_set = ndr_desc->nd_set;
	nd_region->num_lanes = ndr_desc->num_lanes;
Loading