btrfs: remove unlikely from NULL checks
authorDavid Sterba <dsterba@suse.cz>
Mon, 29 Sep 2014 17:20:37 +0000 (19:20 +0200)
committerDavid Sterba <dsterba@suse.cz>
Thu, 2 Oct 2014 14:06:19 +0000 (16:06 +0200)
Unlikely is implicit for NULL checks of pointers.

Signed-off-by: David Sterba <dsterba@suse.cz>
fs/btrfs/async-thread.c
fs/btrfs/inode.c

index 2da0a66790ba841bae9ed0d9d24ef2359cb1657c..4dabeb893b7c18cced67230fd8fbcc36c677983b 100644 (file)
@@ -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;
@@ -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;
        }
@@ -138,12 +138,12 @@ 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;
        }
@@ -151,7 +151,7 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name,
        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;
index 344a322eb3867ef42bf90b1656cb019ba3874bba..998e67fdf2f6b6ce49db5b2eb3106e735ce36714 100644 (file)
@@ -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