summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2011-04-19 18:00:01 +0200
committerDavid Sterba <dsterba@suse.cz>2011-05-02 13:57:20 +0200
commitc704005d886cf0bc9bc3974eb009b22fe0da32c7 (patch)
treeb9effb8d686af95ca92782697b75a70bf34a3964 /fs/btrfs/tree-log.c
parent4891aca2dac612a2f21a3278d9906ade13b55788 (diff)
downloadop-kernel-dev-c704005d886cf0bc9bc3974eb009b22fe0da32c7.zip
op-kernel-dev-c704005d886cf0bc9bc3974eb009b22fe0da32c7.tar.gz
btrfs: unify checking of IS_ERR and null
use IS_ERR_OR_NULL when possible, done by this coccinelle script: @ match @ identifier id; @@ ( - BUG_ON(IS_ERR(id) || !id); + BUG_ON(IS_ERR_OR_NULL(id)); | - IS_ERR(id) || !id + IS_ERR_OR_NULL(id) | - !id || IS_ERR(id) + IS_ERR_OR_NULL(id) ) Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index f997ec0..d5313d6 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -1205,7 +1205,7 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
} else {
BUG();
}
- if (!dst_di || IS_ERR(dst_di)) {
+ if (IS_ERR_OR_NULL(dst_di)) {
/* we need a sequence number to insert, so we only
* do inserts for the BTRFS_DIR_INDEX_KEY types
*/
@@ -1426,7 +1426,7 @@ again:
dir_key->offset,
name, name_len, 0);
}
- if (!log_di || IS_ERR(log_di)) {
+ if (IS_ERR_OR_NULL(log_di)) {
btrfs_dir_item_key_to_cpu(eb, di, &location);
btrfs_release_path(root, path);
btrfs_release_path(log, log_path);
OpenPOWER on IntegriCloud