Skip to content

Commit 2086ca4

Browse files
JeMlaJean Delvare
authored andcommitted
i2c-algo-pca: Fix coding style issues
Fix up some coding style issues. i2c-algo-pca.c has been built successfully after applying this patch and the binary object is still exactly the same. Other issues found by checkpatch.pl were voluntarily not fixed, either to keep readability, or because of false positive errors. Signed-off-by: Farid Hammane <farid.hammane@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
1 parent ae5624f commit 2086ca4

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

‎drivers/i2c/algos/i2c-algo-pca.c‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ static void pca_stop(struct i2c_algo_pca_data *adap)
109109
* returns after the address has been sent
110110
*/
111111
static int pca_address(struct i2c_algo_pca_data *adap,
112-
struct i2c_msg *msg)
112+
struct i2c_msg *msg)
113113
{
114114
int sta = pca_get_con(adap);
115115
int addr;
116116

117-
addr = ( (0x7f & msg->addr) << 1 );
118-
if (msg->flags & I2C_M_RD )
117+
addr = ((0x7f & msg->addr) << 1);
118+
if (msg->flags & I2C_M_RD)
119119
addr |= 1;
120120
DEB2("=== SLAVE ADDRESS %#04x+%c=%#04x\n",
121121
msg->addr, msg->flags & I2C_M_RD ? 'R' : 'W', addr);
@@ -134,7 +134,7 @@ static int pca_address(struct i2c_algo_pca_data *adap,
134134
* Returns after the byte has been transmitted
135135
*/
136136
static int pca_tx_byte(struct i2c_algo_pca_data *adap,
137-
__u8 b)
137+
__u8 b)
138138
{
139139
int sta = pca_get_con(adap);
140140
DEB2("=== WRITE %#04x\n", b);
@@ -164,26 +164,26 @@ static void pca_rx_byte(struct i2c_algo_pca_data *adap,
164164
* Returns after next byte has arrived.
165165
*/
166166
static int pca_rx_ack(struct i2c_algo_pca_data *adap,
167-
int ack)
167+
int ack)
168168
{
169169
int sta = pca_get_con(adap);
170170

171171
sta &= ~(I2C_PCA_CON_STO|I2C_PCA_CON_STA|I2C_PCA_CON_SI|I2C_PCA_CON_AA);
172172

173-
if ( ack )
173+
if (ack)
174174
sta |= I2C_PCA_CON_AA;
175175

176176
pca_set_con(adap, sta);
177177
return pca_wait(adap);
178178
}
179179

180180
static int pca_xfer(struct i2c_adapter *i2c_adap,
181-
struct i2c_msg *msgs,
182-
int num)
181+
struct i2c_msg *msgs,
182+
int num)
183183
{
184-
struct i2c_algo_pca_data *adap = i2c_adap->algo_data;
185-
struct i2c_msg *msg = NULL;
186-
int curmsg;
184+
struct i2c_algo_pca_data *adap = i2c_adap->algo_data;
185+
struct i2c_msg *msg = NULL;
186+
int curmsg;
187187
int numbytes = 0;
188188
int state;
189189
int ret;
@@ -202,21 +202,21 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
202202

203203
DEB1("{{{ XFER %d messages\n", num);
204204

205-
if (i2c_debug>=2) {
205+
if (i2c_debug >= 2) {
206206
for (curmsg = 0; curmsg < num; curmsg++) {
207207
int addr, i;
208208
msg = &msgs[curmsg];
209209

210210
addr = (0x7f & msg->addr) ;
211211

212-
if (msg->flags & I2C_M_RD )
212+
if (msg->flags & I2C_M_RD)
213213
printk(KERN_INFO " [%02d] RD %d bytes from %#02x [%#02x, ...]\n",
214-
curmsg, msg->len, addr, (addr<<1) | 1);
214+
curmsg, msg->len, addr, (addr << 1) | 1);
215215
else {
216216
printk(KERN_INFO " [%02d] WR %d bytes to %#02x [%#02x%s",
217-
curmsg, msg->len, addr, addr<<1,
217+
curmsg, msg->len, addr, addr << 1,
218218
msg->len == 0 ? "" : ", ");
219-
for(i=0; i < msg->len; i++)
219+
for (i = 0; i < msg->len; i++)
220220
printk("%#04x%s", msg->buf[i], i == msg->len - 1 ? "" : ", ");
221221
printk("]\n");
222222
}
@@ -305,7 +305,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
305305
goto out;
306306

307307
case 0x58: /* Data byte has been received; NOT ACK has been returned */
308-
if ( numbytes == msg->len - 1 ) {
308+
if (numbytes == msg->len - 1) {
309309
pca_rx_byte(adap, &msg->buf[numbytes], 0);
310310
curmsg++; numbytes = 0;
311311
if (curmsg == num)
@@ -352,7 +352,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
352352

353353
static u32 pca_func(struct i2c_adapter *adap)
354354
{
355-
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
355+
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
356356
}
357357

358358
static const struct i2c_algorithm pca_algo = {

0 commit comments

Comments
 (0)