diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-05-27 22:28:31 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-06-18 01:23:23 +0200 |
commit | 42588958147c7cc5a68726f14579011ad96663bb (patch) | |
tree | ee67e2dfa93650c6f16ba83145d056f45767d8b3 /drivers/nvdimm/claim.c | |
parent | libnvdimm, btt: update the usage section in Documentation (diff) | |
download | linux-42588958147c7cc5a68726f14579011ad96663bb.tar.xz linux-42588958147c7cc5a68726f14579011ad96663bb.zip |
libnvdimm: IS_ERR() usage cleanup
Prompted by commit 287980e49ffc "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: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/claim.c')
-rw-r--r-- | drivers/nvdimm/claim.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c index 8b2e3c4fb0ad..9997ff94a132 100644 --- a/drivers/nvdimm/claim.c +++ b/drivers/nvdimm/claim.c @@ -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), ARCH_MEMREMAP_PMEM); - if (IS_ERR(nsio->addr)) - return PTR_ERR(nsio->addr); - return 0; + + return PTR_ERR_OR_ZERO(nsio->addr); } EXPORT_SYMBOL_GPL(devm_nsio_enable); |