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>
This commit is contained in:
David Sterba 2011-04-19 18:00:01 +02:00
parent 4891aca2da
commit c704005d88
6 changed files with 17 additions and 17 deletions

View file

@ -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);