Commit 2086ca48 authored by Farid Hammane's avatar Farid Hammane Committed by Jean Delvare

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: default avatarFarid Hammane <farid.hammane@gmail.com>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent ae5624fc
...@@ -114,8 +114,8 @@ static int pca_address(struct i2c_algo_pca_data *adap, ...@@ -114,8 +114,8 @@ static int pca_address(struct i2c_algo_pca_data *adap,
int sta = pca_get_con(adap); int sta = pca_get_con(adap);
int addr; int addr;
addr = ( (0x7f & msg->addr) << 1 ); addr = ((0x7f & msg->addr) << 1);
if (msg->flags & I2C_M_RD ) if (msg->flags & I2C_M_RD)
addr |= 1; addr |= 1;
DEB2("=== SLAVE ADDRESS %#04x+%c=%#04x\n", DEB2("=== SLAVE ADDRESS %#04x+%c=%#04x\n",
msg->addr, msg->flags & I2C_M_RD ? 'R' : 'W', addr); msg->addr, msg->flags & I2C_M_RD ? 'R' : 'W', addr);
...@@ -170,7 +170,7 @@ static int pca_rx_ack(struct i2c_algo_pca_data *adap, ...@@ -170,7 +170,7 @@ static int pca_rx_ack(struct i2c_algo_pca_data *adap,
sta &= ~(I2C_PCA_CON_STO|I2C_PCA_CON_STA|I2C_PCA_CON_SI|I2C_PCA_CON_AA); sta &= ~(I2C_PCA_CON_STO|I2C_PCA_CON_STA|I2C_PCA_CON_SI|I2C_PCA_CON_AA);
if ( ack ) if (ack)
sta |= I2C_PCA_CON_AA; sta |= I2C_PCA_CON_AA;
pca_set_con(adap, sta); pca_set_con(adap, sta);
...@@ -202,21 +202,21 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, ...@@ -202,21 +202,21 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
DEB1("{{{ XFER %d messages\n", num); DEB1("{{{ XFER %d messages\n", num);
if (i2c_debug>=2) { if (i2c_debug >= 2) {
for (curmsg = 0; curmsg < num; curmsg++) { for (curmsg = 0; curmsg < num; curmsg++) {
int addr, i; int addr, i;
msg = &msgs[curmsg]; msg = &msgs[curmsg];
addr = (0x7f & msg->addr) ; addr = (0x7f & msg->addr) ;
if (msg->flags & I2C_M_RD ) if (msg->flags & I2C_M_RD)
printk(KERN_INFO " [%02d] RD %d bytes from %#02x [%#02x, ...]\n", printk(KERN_INFO " [%02d] RD %d bytes from %#02x [%#02x, ...]\n",
curmsg, msg->len, addr, (addr<<1) | 1); curmsg, msg->len, addr, (addr << 1) | 1);
else { else {
printk(KERN_INFO " [%02d] WR %d bytes to %#02x [%#02x%s", printk(KERN_INFO " [%02d] WR %d bytes to %#02x [%#02x%s",
curmsg, msg->len, addr, addr<<1, curmsg, msg->len, addr, addr << 1,
msg->len == 0 ? "" : ", "); msg->len == 0 ? "" : ", ");
for(i=0; i < msg->len; i++) for (i = 0; i < msg->len; i++)
printk("%#04x%s", msg->buf[i], i == msg->len - 1 ? "" : ", "); printk("%#04x%s", msg->buf[i], i == msg->len - 1 ? "" : ", ");
printk("]\n"); printk("]\n");
} }
...@@ -305,7 +305,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, ...@@ -305,7 +305,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
goto out; goto out;
case 0x58: /* Data byte has been received; NOT ACK has been returned */ case 0x58: /* Data byte has been received; NOT ACK has been returned */
if ( numbytes == msg->len - 1 ) { if (numbytes == msg->len - 1) {
pca_rx_byte(adap, &msg->buf[numbytes], 0); pca_rx_byte(adap, &msg->buf[numbytes], 0);
curmsg++; numbytes = 0; curmsg++; numbytes = 0;
if (curmsg == num) if (curmsg == num)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment