From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: tim@cyberelk.net
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org,
Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH 1/2] paride: clean up some inconsistent indenting
Date: Sat, 7 May 2022 17:15:36 +0800 [thread overview]
Message-ID: <20220507091536.32211-2-jiapeng.chong@linux.alibaba.com> (raw)
In-Reply-To: <20220507091536.32211-1-jiapeng.chong@linux.alibaba.com>
Eliminate the follow smatch warning:
drivers/block/paride/on26.c:158 on26_test_port() warn: inconsistent
indenting.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
drivers/block/paride/on26.c | 85 +++++++++++++++++++------------------
1 file changed, 44 insertions(+), 41 deletions(-)
diff --git a/drivers/block/paride/on26.c b/drivers/block/paride/on26.c
index 95ba256921f2..d2ee74dbee29 100644
--- a/drivers/block/paride/on26.c
+++ b/drivers/block/paride/on26.c
@@ -125,61 +125,64 @@ static void on26_disconnect ( PIA *pi )
#define RESET_WAIT 200
static int on26_test_port( PIA *pi) /* hard reset */
+{
+ int i, m, d, x = 0, y = 0;
-{ int i, m, d, x=0, y=0;
-
- pi->saved_r0 = r0();
- pi->saved_r2 = r2();
+ pi->saved_r0 = r0();
+ pi->saved_r2 = r2();
- d = pi->delay;
- m = pi->mode;
- pi->delay = 5;
- pi->mode = 0;
+ d = pi->delay;
+ m = pi->mode;
+ pi->delay = 5;
+ pi->mode = 0;
- w2(0xc);
+ w2(0xc);
- CCP(0x30); CCP(0);
+ CCP(0x30); CCP(0);
- w0(0xfe);w0(0xaa);w0(0x55);w0(0);w0(0xff);
- i = ((r1() & 0xf0) << 4); w0(0x87);
- i |= (r1() & 0xf0); w0(0x78);
- w0(0x20);w2(4);w2(5);
- i |= ((r1() & 0xf0) >> 4);
- w2(4);w0(0xff);
+ w0(0xfe); w0(0xaa); w0(0x55); w0(0); w0(0xff);
+ i = ((r1() & 0xf0) << 4); w0(0x87);
+ i |= (r1() & 0xf0); w0(0x78);
+ w0(0x20); w2(4); w2(5);
+ i |= ((r1() & 0xf0) >> 4);
+ w2(4); w0(0xff);
- if (i == 0xb5f) {
+ if (i == 0xb5f) {
- w0(2); P1; w0(0); P2;
- w0(3); P1; w0(0); P2;
- w0(2); P1; w0(8); P2; udelay(100);
- w0(2); P1; w0(0xa); P2; udelay(100);
- w0(2); P1; w0(8); P2; udelay(1000);
+ w0(2); P1; w0(0); P2;
+ w0(3); P1; w0(0); P2;
+ w0(2); P1; w0(8); P2; udelay(100);
+ w0(2); P1; w0(0xa); P2; udelay(100);
+ w0(2); P1; w0(8); P2; udelay(1000);
- on26_write_regr(pi,0,6,0xa0);
+ on26_write_regr(pi, 0, 6, 0xa0);
- for (i=0;i<RESET_WAIT;i++) {
- on26_write_regr(pi,0,6,0xa0);
- x = on26_read_regr(pi,0,7);
- on26_write_regr(pi,0,6,0xb0);
- y = on26_read_regr(pi,0,7);
- if (!((x&0x80)||(y&0x80))) break;
- mdelay(100);
- }
+ for (i = 0; i < RESET_WAIT; i++) {
+ on26_write_regr(pi, 0, 6, 0xa0);
+ x = on26_read_regr(pi, 0, 7);
- if (i == RESET_WAIT)
- printk("on26: Device reset failed (%x,%x)\n",x,y);
+ on26_write_regr(pi, 0, 6, 0xb0);
+ y = on26_read_regr(pi, 0, 7);
- w0(4); P1; w0(4); P1;
- }
+ if (!((x & 0x80) || (y & 0x80)))
+ break;
+ mdelay(100);
+ }
- CCP(0x30);
+ if (i == RESET_WAIT)
+ printk("on26: Device reset failed (%x,%x)\n", x, y);
- pi->delay = d;
- pi->mode = m;
- w0(pi->saved_r0);
- w2(pi->saved_r2);
+ w0(4); P1; w0(4); P1;
+ }
+
+ CCP(0x30);
+
+ pi->delay = d;
+ pi->mode = m;
+ w0(pi->saved_r0);
+ w2(pi->saved_r2);
- return 5;
+ return 5;
}
--
2.20.1.7.g153144c
prev parent reply other threads:[~2022-05-07 9:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-07 9:15 [PATCH 2/2] " Jiapeng Chong
2022-05-07 9:15 ` Jiapeng Chong [this message]
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=20220507091536.32211-2-jiapeng.chong@linux.alibaba.com \
--to=jiapeng.chong@linux.alibaba.com \
--cc=abaci@linux.alibaba.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tim@cyberelk.net \
/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
all inboxes | Powered by JetHome®