Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Farid Hammane and committed by
Jean Delvare
2086ca48 ae5624fc

+18 -18
+18 -18
drivers/i2c/algos/i2c-algo-pca.c
··· 109 109 * returns after the address has been sent 110 110 */ 111 111 static int pca_address(struct i2c_algo_pca_data *adap, 112 - struct i2c_msg *msg) 112 + struct i2c_msg *msg) 113 113 { 114 114 int sta = pca_get_con(adap); 115 115 int addr; 116 116 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) 119 119 addr |= 1; 120 120 DEB2("=== SLAVE ADDRESS %#04x+%c=%#04x\n", 121 121 msg->addr, msg->flags & I2C_M_RD ? 'R' : 'W', addr); ··· 134 134 * Returns after the byte has been transmitted 135 135 */ 136 136 static int pca_tx_byte(struct i2c_algo_pca_data *adap, 137 - __u8 b) 137 + __u8 b) 138 138 { 139 139 int sta = pca_get_con(adap); 140 140 DEB2("=== WRITE %#04x\n", b); ··· 164 164 * Returns after next byte has arrived. 165 165 */ 166 166 static int pca_rx_ack(struct i2c_algo_pca_data *adap, 167 - int ack) 167 + int ack) 168 168 { 169 169 int sta = pca_get_con(adap); 170 170 171 171 sta &= ~(I2C_PCA_CON_STO|I2C_PCA_CON_STA|I2C_PCA_CON_SI|I2C_PCA_CON_AA); 172 172 173 - if ( ack ) 173 + if (ack) 174 174 sta |= I2C_PCA_CON_AA; 175 175 176 176 pca_set_con(adap, sta); ··· 178 178 } 179 179 180 180 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) 183 183 { 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; 187 187 int numbytes = 0; 188 188 int state; 189 189 int ret; ··· 202 202 203 203 DEB1("{{{ XFER %d messages\n", num); 204 204 205 - if (i2c_debug>=2) { 205 + if (i2c_debug >= 2) { 206 206 for (curmsg = 0; curmsg < num; curmsg++) { 207 207 int addr, i; 208 208 msg = &msgs[curmsg]; 209 209 210 210 addr = (0x7f & msg->addr) ; 211 211 212 - if (msg->flags & I2C_M_RD ) 212 + if (msg->flags & I2C_M_RD) 213 213 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); 215 215 else { 216 216 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, 218 218 msg->len == 0 ? "" : ", "); 219 - for(i=0; i < msg->len; i++) 219 + for (i = 0; i < msg->len; i++) 220 220 printk("%#04x%s", msg->buf[i], i == msg->len - 1 ? "" : ", "); 221 221 printk("]\n"); 222 222 } ··· 305 305 goto out; 306 306 307 307 case 0x58: /* Data byte has been received; NOT ACK has been returned */ 308 - if ( numbytes == msg->len - 1 ) { 308 + if (numbytes == msg->len - 1) { 309 309 pca_rx_byte(adap, &msg->buf[numbytes], 0); 310 310 curmsg++; numbytes = 0; 311 311 if (curmsg == num) ··· 352 352 353 353 static u32 pca_func(struct i2c_adapter *adap) 354 354 { 355 - return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; 355 + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; 356 356 } 357 357 358 358 static const struct i2c_algorithm pca_algo = {