From c6114a600b284d3ef8b1255e7127815c49d20c9d Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 24 Jun 2020 15:58:36 +0200 Subject: treewide: make use of PTR_ERR_OR_ZERO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PTR_ERR_OR_ZERO is designed to replace boiler plate like: if (IS_ERR(x)) return PTR_ERR(x); return 0; Signed-off-by: Uwe Kleine-König Signed-off-by: Sascha Hauer --- drivers/mtd/ubi/eba.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'drivers/mtd/ubi') diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index cca6ec4ba9..071bbca236 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c @@ -324,9 +324,7 @@ static int leb_read_lock(struct ubi_device *ubi, int vol_id, int lnum) struct ubi_ltree_entry *le; le = ltree_add_entry(ubi, vol_id, lnum); - if (IS_ERR(le)) - return PTR_ERR(le); - return 0; + return PTR_ERR_OR_ZERO(le); } /** @@ -362,9 +360,7 @@ static int leb_write_lock(struct ubi_device *ubi, int vol_id, int lnum) struct ubi_ltree_entry *le; le = ltree_add_entry(ubi, vol_id, lnum); - if (IS_ERR(le)) - return PTR_ERR(le); - return 0; + return PTR_ERR_OR_ZERO(le); } /** @@ -383,9 +379,7 @@ static int leb_write_trylock(struct ubi_device *ubi, int vol_id, int lnum) struct ubi_ltree_entry *le; le = ltree_add_entry(ubi, vol_id, lnum); - if (IS_ERR(le)) - return PTR_ERR(le); - return 0; + return PTR_ERR_OR_ZERO(le); } /** -- cgit v1.2.3