bcache: do not assign in if condition in bcache_init()
authorFlorian Schmaus <flo@geekplace.eu>
Thu, 26 Jul 2018 04:17:39 +0000 (12:17 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 27 Jul 2018 15:15:46 +0000 (09:15 -0600)
Fixes an error condition reported by checkpatch.pl which is caused by
assigning a variable in an if condition.

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/super.c

index 093b3789ce05b1b2b4cba3f6a9bc290da6d0901d..a852018964adbe5e0e51e11669961e9f153b69bc 100644 (file)
@@ -2330,9 +2330,15 @@ static int __init bcache_init(void)
                return bcache_major;
        }
 
-       if (!(bcache_wq = alloc_workqueue("bcache", WQ_MEM_RECLAIM, 0)) ||
-           !(bcache_kobj = kobject_create_and_add("bcache", fs_kobj)) ||
-           bch_request_init() ||
+       bcache_wq = alloc_workqueue("bcache", WQ_MEM_RECLAIM, 0);
+       if (!bcache_wq)
+               goto err;
+
+       bcache_kobj = kobject_create_and_add("bcache", fs_kobj);
+       if (!bcache_kobj)
+               goto err;
+
+       if (bch_request_init() ||
            bch_debug_init(bcache_kobj) || closure_debug_init() ||
            sysfs_create_files(bcache_kobj, files))
                goto err;