Skip to content

Commit

Permalink
btrfs: remove unlikely from NULL checks
Browse files Browse the repository at this point in the history
Unlikely is implicit for NULL checks of pointers.

Signed-off-by: David Sterba <dsterba@suse.cz>
  • Loading branch information
David Sterba committed Oct 2, 2014
1 parent 1d52c78 commit 5d99a99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions fs/btrfs/async-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ __btrfs_alloc_workqueue(const char *name, int flags, int max_active,
{
struct __btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS);

if (unlikely(!ret))
if (!ret)
return NULL;

ret->max_active = max_active;
Expand All @@ -116,7 +116,7 @@ __btrfs_alloc_workqueue(const char *name, int flags, int max_active,
ret->normal_wq = alloc_workqueue("%s-%s", flags,
ret->max_active, "btrfs",
name);
if (unlikely(!ret->normal_wq)) {
if (!ret->normal_wq) {
kfree(ret);
return NULL;
}
Expand All @@ -138,20 +138,20 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name,
{
struct btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS);

if (unlikely(!ret))
if (!ret)
return NULL;

ret->normal = __btrfs_alloc_workqueue(name, flags & ~WQ_HIGHPRI,
max_active, thresh);
if (unlikely(!ret->normal)) {
if (!ret->normal) {
kfree(ret);
return NULL;
}

if (flags & WQ_HIGHPRI) {
ret->high = __btrfs_alloc_workqueue(name, flags, max_active,
thresh);
if (unlikely(!ret->high)) {
if (!ret->high) {
__btrfs_destroy_workqueue(ret->normal);
kfree(ret);
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -9013,7 +9013,7 @@ static int __start_delalloc_inodes(struct btrfs_root *root, int delay_iput,
spin_unlock(&root->delalloc_lock);

work = btrfs_alloc_delalloc_work(inode, 0, delay_iput);
if (unlikely(!work)) {
if (!work) {
if (delay_iput)
btrfs_add_delayed_iput(inode);
else
Expand Down

0 comments on commit 5d99a99

Please sign in to comment.