Commit 42588958 authored by Dan Williams's avatar Dan Williams

libnvdimm: IS_ERR() usage cleanup

Prompted by commit 287980e4 "remove lots of IS_ERR_VALUE abuses", I
ran make coccicheck against drivers/nvdimm/ and found that:

	if (IS_ERR(x))
		return PTR_ERR(x);
	return 0;

...can be replaced with PTR_ERR_OR_ZERO().
Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 0aefa054
...@@ -395,12 +395,10 @@ int nvdimm_bus_create_ndctl(struct nvdimm_bus *nvdimm_bus) ...@@ -395,12 +395,10 @@ int nvdimm_bus_create_ndctl(struct nvdimm_bus *nvdimm_bus)
dev = device_create(nd_class, &nvdimm_bus->dev, devt, nvdimm_bus, dev = device_create(nd_class, &nvdimm_bus->dev, devt, nvdimm_bus,
"ndctl%d", nvdimm_bus->id); "ndctl%d", nvdimm_bus->id);
if (IS_ERR(dev)) { if (IS_ERR(dev))
dev_dbg(&nvdimm_bus->dev, "failed to register ndctl%d: %ld\n", dev_dbg(&nvdimm_bus->dev, "failed to register ndctl%d: %ld\n",
nvdimm_bus->id, PTR_ERR(dev)); nvdimm_bus->id, PTR_ERR(dev));
return PTR_ERR(dev); return PTR_ERR_OR_ZERO(dev);
}
return 0;
} }
void nvdimm_bus_destroy_ndctl(struct nvdimm_bus *nvdimm_bus) void nvdimm_bus_destroy_ndctl(struct nvdimm_bus *nvdimm_bus)
......
...@@ -266,9 +266,8 @@ int devm_nsio_enable(struct device *dev, struct nd_namespace_io *nsio) ...@@ -266,9 +266,8 @@ int devm_nsio_enable(struct device *dev, struct nd_namespace_io *nsio)
nsio->addr = devm_memremap(dev, res->start, resource_size(res), nsio->addr = devm_memremap(dev, res->start, resource_size(res),
ARCH_MEMREMAP_PMEM); ARCH_MEMREMAP_PMEM);
if (IS_ERR(nsio->addr))
return PTR_ERR(nsio->addr); return PTR_ERR_OR_ZERO(nsio->addr);
return 0;
} }
EXPORT_SYMBOL_GPL(devm_nsio_enable); EXPORT_SYMBOL_GPL(devm_nsio_enable);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment