From: Florian Schmaus <flo@geekplace.eu>
To: Coly Li <colyli@suse.de>,
Kent Overstreet <kent.overstreet@gmail.com>,
linux-bcache@vger.kernel.org
Cc: Florian Schmaus <flo@geekplace.eu>, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] bcache: do not assign in if condition in bcache_init()
Date: Mon, 18 Jun 2018 12:09:01 +0200 [thread overview]
Message-ID: <20180618100902.4015-3-flo@geekplace.eu> (raw)
In-Reply-To: <20180618100902.4015-1-flo@geekplace.eu>
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>
---
drivers/md/bcache/super.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index db7177d422e5..f09f4f046315 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -2328,9 +2328,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;
--
2.16.4
next prev parent reply other threads:[~2018-06-18 10:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-18 10:08 [PATCH 0/3] bcache: Fix variable assignment in if condition in super.c Florian Schmaus
2018-06-18 10:09 ` [PATCH 1/3] bcache: do not assign in if condition register_bcache() Florian Schmaus
2018-06-18 13:44 ` Coly Li
2018-06-18 10:09 ` Florian Schmaus [this message]
2018-06-18 13:44 ` [PATCH 2/3] bcache: do not assign in if condition in bcache_init() Coly Li
2018-06-18 10:09 ` [PATCH 3/3] bcache: do not assign in if condition in bcache_device_init() Florian Schmaus
2018-06-18 13:45 ` Coly Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180618100902.4015-3-flo@geekplace.eu \
--to=flo@geekplace.eu \
--cc=colyli@suse.de \
--cc=kent.overstreet@gmail.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).