Skip to content

Commit ece68db

Browse files
committed
ata: pata_parport: Fix ktti module code indentation and style
Fix the header, indentation and coding style in the ktti pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent 65db10c commit ece68db

1 file changed

Lines changed: 40 additions & 45 deletions

File tree

  • drivers/ata/pata_parport

drivers/ata/pata_parport/ktti.c

Lines changed: 40 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
/*
2-
ktti.c (c) 1998 Grant R. Guenther <grant@torque.net>
3-
Under the terms of the GNU General Public License.
4-
5-
ktti.c is a low-level protocol driver for the KT Technology
6-
parallel port adapter. This adapter is used in the "PHd"
7-
portable hard-drives. As far as I can tell, this device
8-
supports 4-bit mode _only_.
9-
1+
// SPDX-License-Identifier: GPL-2.0-or-later
2+
/*
3+
* (c) 1998 Grant R. Guenther <grant@torque.net>
4+
*
5+
* ktti.c is a low-level protocol driver for the KT Technology
6+
* parallel port adapter. This adapter is used in the "PHd"
7+
* portable hard-drives. As far as I can tell, this device
8+
* supports 4-bit mode _only_.
109
*/
1110

1211
#include <linux/module.h>
@@ -18,80 +17,76 @@
1817
#include <asm/io.h>
1918
#include "pata_parport.h"
2019

21-
#define j44(a,b) (((a>>4)&0x0f)|(b&0xf0))
20+
#define j44(a, b) (((a >> 4) & 0x0f) | (b & 0xf0))
2221

23-
/* cont = 0 - access the IDE register file
24-
cont = 1 - access the IDE command set
25-
*/
26-
27-
static int cont_map[2] = { 0x10, 0x08 };
22+
/*
23+
* cont = 0 - access the IDE register file
24+
* cont = 1 - access the IDE command set
25+
*/
26+
static int cont_map[2] = { 0x10, 0x08 };
2827

2928
static void ktti_write_regr(struct pi_adapter *pi, int cont, int regr, int val)
29+
{
30+
int r = regr + cont_map[cont];
3031

31-
{ int r;
32-
33-
r = regr + cont_map[cont];
34-
35-
w0(r); w2(0xb); w2(0xa); w2(3); w2(6);
32+
w0(r); w2(0xb); w2(0xa); w2(3); w2(6);
3633
w0(val); w2(3); w0(0); w2(6); w2(0xb);
3734
}
3835

3936
static int ktti_read_regr(struct pi_adapter *pi, int cont, int regr)
40-
41-
{ int a, b, r;
37+
{
38+
int a, b, r;
4239

4340
r = regr + cont_map[cont];
4441

45-
w0(r); w2(0xb); w2(0xa); w2(9); w2(0xc); w2(9);
42+
w0(r); w2(0xb); w2(0xa); w2(9); w2(0xc); w2(9);
4643
a = r1(); w2(0xc); b = r1(); w2(9); w2(0xc); w2(9);
47-
return j44(a,b);
48-
44+
return j44(a, b);
4945
}
5046

5147
static void ktti_read_block(struct pi_adapter *pi, char *buf, int count)
48+
{
49+
int k, a, b;
5250

53-
{ int k, a, b;
54-
55-
for (k=0;k<count/2;k++) {
51+
for (k = 0; k < count / 2; k++) {
5652
w0(0x10); w2(0xb); w2(0xa); w2(9); w2(0xc); w2(9);
5753
a = r1(); w2(0xc); b = r1(); w2(9);
58-
buf[2*k] = j44(a,b);
54+
buf[2*k] = j44(a, b);
5955
a = r1(); w2(0xc); b = r1(); w2(9);
60-
buf[2*k+1] = j44(a,b);
56+
buf[2*k+1] = j44(a, b);
6157
}
6258
}
6359

6460
static void ktti_write_block(struct pi_adapter *pi, char *buf, int count)
61+
{
62+
int k;
6563

66-
{ int k;
67-
68-
for (k=0;k<count/2;k++) {
64+
for (k = 0; k < count / 2; k++) {
6965
w0(0x10); w2(0xb); w2(0xa); w2(3); w2(6);
70-
w0(buf[2*k]); w2(3);
71-
w0(buf[2*k+1]); w2(6);
66+
w0(buf[2 * k]); w2(3);
67+
w0(buf[2 * k + 1]); w2(6);
7268
w2(0xb);
7369
}
7470
}
7571

7672
static void ktti_connect(struct pi_adapter *pi)
77-
78-
{ pi->saved_r0 = r0();
79-
pi->saved_r2 = r2();
80-
w2(0xb); w2(0xa); w0(0); w2(3); w2(6);
73+
{
74+
pi->saved_r0 = r0();
75+
pi->saved_r2 = r2();
76+
w2(0xb); w2(0xa); w0(0); w2(3); w2(6);
8177
}
8278

8379
static void ktti_disconnect(struct pi_adapter *pi)
84-
85-
{ w2(0xb); w2(0xa); w0(0xa0); w2(3); w2(4);
80+
{
81+
w2(0xb); w2(0xa); w0(0xa0); w2(3); w2(4);
8682
w0(pi->saved_r0);
87-
w2(pi->saved_r2);
88-
}
83+
w2(pi->saved_r2);
84+
}
8985

9086
static void ktti_log_adapter(struct pi_adapter *pi)
91-
9287
{
9388
dev_info(&pi->dev, "KT adapter at 0x%x, delay %d\n",
94-
pi->port, pi->delay);
89+
pi->port, pi->delay);
9590
}
9691

9792
static struct pi_protocol ktti = {

0 commit comments

Comments
 (0)