From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-raid@vger.kernel.org, Neil Brown <neilb@suse.com>,
Shaohua Li <shli@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 6/6] md: Add some spaces for better code readability
Date: Tue, 2 May 2017 16:31:00 +0200 [thread overview]
Message-ID: <9ef3d847-cab3-d7e4-7d76-2c41700df779@users.sourceforge.net> (raw)
In-Reply-To: <f05bfc4e-7935-7e87-cc85-f0d9c5e3846a@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 2 May 2017 16:00:45 +0200
Use space characters and blank lines at some source code places
according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/md/faulty.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c
index 2573009b1265..434c3643c9c3 100644
--- a/drivers/md/faulty.c
+++ b/drivers/md/faulty.c
@@ -110,19 +110,20 @@ static int check_sector(struct faulty_conf *conf, sector_t start, sector_t end,
{
/* If we find a ReadFixable sector, we fix it ... */
int i;
- for (i=0; i<conf->nfaults; i++)
+
+ for (i = 0; i < conf->nfaults; i++)
if (conf->faults[i] >= start &&
conf->faults[i] < end) {
/* found it ... */
switch (conf->modes[i] * 2 + dir) {
- case WritePersistent*2+WRITE: return 1;
- case ReadPersistent*2+READ: return 1;
- case ReadFixable*2+READ: return 1;
- case ReadFixable*2+WRITE:
+ case WritePersistent * 2 + WRITE: return 1;
+ case ReadPersistent * 2 + READ: return 1;
+ case ReadFixable * 2 + READ: return 1;
+ case ReadFixable * 2 + WRITE:
conf->modes[i] = NoPersist;
return 0;
- case AllPersist*2+READ:
- case AllPersist*2+WRITE: return 1;
+ case AllPersist * 2 + READ:
+ case AllPersist * 2 + WRITE: return 1;
default:
return 0;
}
@@ -134,9 +135,10 @@ static void add_sector(struct faulty_conf *conf, sector_t start, int mode)
{
int i;
int n = conf->nfaults;
- for (i=0; i<conf->nfaults; i++)
+
+ for (i = 0; i < conf->nfaults; i++)
if (conf->faults[i] == start) {
- switch(mode) {
+ switch (mode) {
case NoPersist: conf->modes[i] = mode; return;
case WritePersistent:
if (conf->modes[i] == ReadPersistent ||
@@ -167,7 +169,7 @@ static void add_sector(struct faulty_conf *conf, sector_t start, int mode)
conf->faults[n] = start;
conf->modes[n] = mode;
if (conf->nfaults == n)
- conf->nfaults = n+1;
+ conf->nfaults = n + 1;
}
static void faulty_make_request(struct mddev *mddev, struct bio *bio)
@@ -278,7 +280,8 @@ static int faulty_reshape(struct mddev *mddev)
conf->nfaults = 0;
else if (mode == ClearErrors) {
int i;
- for (i=0 ; i < Modes ; i++) {
+
+ for (i = 0; i < Modes; i++) {
conf->period[i] = 0;
atomic_set(&conf->counters[i], 0);
}
@@ -317,7 +320,7 @@ static int faulty_run(struct mddev *mddev)
if (!conf)
return -ENOMEM;
- for (i=0; i<Modes; i++) {
+ for (i = 0; i < Modes; i++) {
atomic_set(&conf->counters[i], 0);
conf->period[i] = 0;
}
--
2.12.2
next prev parent reply other threads:[~2017-05-02 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 14:23 [PATCH 0/6] md: Fine-tuning for some function implementations SF Markus Elfring
2017-05-02 14:25 ` [PATCH 1/6] md: Replace seven seq_printf() calls by seq_putc() SF Markus Elfring
2017-05-02 14:26 ` [PATCH 2/6] md: Replace 17 seq_printf() calls by seq_puts() SF Markus Elfring
2017-05-02 14:27 ` [PATCH 3/6] md: Adjust four function calls together with a variable assignment SF Markus Elfring
2017-05-02 14:28 ` [PATCH 4/6] md: Use seq_puts() in faulty_status() SF Markus Elfring
2017-05-02 14:29 ` [PATCH 5/6] md: Adjust six function calls together with a variable assignment " SF Markus Elfring
2017-05-02 14:31 ` SF Markus Elfring [this message]
2017-05-02 21:36 ` [PATCH 0/6] md: Fine-tuning for some function implementations NeilBrown
2017-05-03 7:38 ` Nikola Pajkovsky
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=9ef3d847-cab3-d7e4-7d76-2c41700df779@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.com \
--cc=shli@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).