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

staging: sm750fb: ddk750_*i2c: shorten lines to under 80 characters

Fix some checkpatch warnings about long lines

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mike Rapoport and committed by
Greg Kroah-Hartman
9137f812 987f202a

+32 -12
+14 -5
drivers/staging/sm750fb/ddk750_hwi2c.c
··· 63 63 64 64 /* Wait until the transfer is completed. */ 65 65 timeout = HWI2C_WAIT_TIMEOUT; 66 - while ((FIELD_GET(PEEK32(I2C_STATUS), I2C_STATUS, TX) != I2C_STATUS_TX_COMPLETED) && 66 + while ((FIELD_GET(PEEK32(I2C_STATUS), 67 + I2C_STATUS, TX) != I2C_STATUS_TX_COMPLETED) && 67 68 (timeout != 0)) 68 69 timeout--; 69 70 ··· 103 102 * Only 16 byte can be accessed per i2c start instruction. 104 103 */ 105 104 do { 106 - /* Reset I2C by writing 0 to I2C_RESET register to clear the previous status. */ 105 + /* 106 + * Reset I2C by writing 0 to I2C_RESET register to 107 + * clear the previous status. 108 + */ 107 109 POKE32(I2C_RESET, 0); 108 110 109 111 /* Set the number of bytes to be written */ ··· 121 117 POKE32(I2C_DATA0 + i, *buf++); 122 118 123 119 /* Start the I2C */ 124 - POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, START)); 120 + POKE32(I2C_CTRL, 121 + FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, START)); 125 122 126 123 /* Wait until the transfer is completed. */ 127 124 if (hw_i2c_wait_tx_done() != 0) ··· 170 165 * Only 16 byte can be accessed per i2c start instruction. 171 166 */ 172 167 do { 173 - /* Reset I2C by writing 0 to I2C_RESET register to clear all the status. */ 168 + /* 169 + * Reset I2C by writing 0 to I2C_RESET register to 170 + * clear all the status. 171 + */ 174 172 POKE32(I2C_RESET, 0); 175 173 176 174 /* Set the number of bytes to be read */ ··· 184 176 POKE32(I2C_BYTE_COUNT, count); 185 177 186 178 /* Start the I2C */ 187 - POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, START)); 179 + POKE32(I2C_CTRL, 180 + FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, START)); 188 181 189 182 /* Wait until transaction done. */ 190 183 if (hw_i2c_wait_tx_done() != 0)
+2 -1
drivers/staging/sm750fb/ddk750_hwi2c.h
··· 6 6 void sm750_hw_i2c_close(void); 7 7 8 8 unsigned char sm750_hw_i2c_read_reg(unsigned char addr, unsigned char reg); 9 - int sm750_hw_i2c_write_reg(unsigned char addr, unsigned char reg, unsigned char data); 9 + int sm750_hw_i2c_write_reg(unsigned char addr, unsigned char reg, 10 + unsigned char data); 10 11 #endif
+16 -6
drivers/staging/sm750fb/ddk750_swi2c.c
··· 125 125 126 126 gpio_dir = PEEK32(sw_i2c_clk_gpio_data_dir_reg); 127 127 if (value) { /* High */ 128 - /* Set direction as input. This will automatically pull the signal up. */ 128 + /* 129 + * Set direction as input. This will automatically 130 + * pull the signal up. 131 + */ 129 132 gpio_dir &= ~(1 << sw_i2c_clk_gpio); 130 133 POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir); 131 134 } else { /* Low */ ··· 162 159 163 160 gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg); 164 161 if (value) { /* High */ 165 - /* Set direction as input. This will automatically pull the signal up. */ 162 + /* 163 + * Set direction as input. This will automatically 164 + * pull the signal up. 165 + */ 166 166 gpio_dir &= ~(1 << sw_i2c_data_gpio); 167 167 POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir); 168 168 } else { /* Low */ ··· 190 184 { 191 185 unsigned long gpio_dir; 192 186 unsigned long gpio_data; 187 + unsigned long dir_mask = 1 << sw_i2c_data_gpio; 193 188 194 189 /* Make sure that the direction is input (High) */ 195 190 gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg); 196 - if ((gpio_dir & (1 << sw_i2c_data_gpio)) != (~(1 << sw_i2c_data_gpio))) { 191 + if ((gpio_dir & dir_mask) != ~dir_mask) { 197 192 gpio_dir &= ~(1 << sw_i2c_data_gpio); 198 193 POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir); 199 194 } ··· 399 392 { 400 393 int i; 401 394 402 - /* Return 0 if the GPIO pins to be used is out of range. The range is only from [0..63] */ 395 + /* 396 + * Return 0 if the GPIO pins to be used is out of range. The 397 + * range is only from [0..63] 398 + */ 403 399 if ((clk_gpio > 31) || (data_gpio > 31)) 404 400 return -1; 405 401 ··· 427 417 428 418 /* Enable the GPIO pins for the i2c Clock and Data (GPIO MUX) */ 429 419 POKE32(sw_i2c_clk_gpio_mux_reg, 430 - PEEK32(sw_i2c_clk_gpio_mux_reg) & ~(1 << sw_i2c_clk_gpio)); 420 + PEEK32(sw_i2c_clk_gpio_mux_reg) & ~(1 << sw_i2c_clk_gpio)); 431 421 POKE32(sw_i2c_data_gpio_mux_reg, 432 - PEEK32(sw_i2c_data_gpio_mux_reg) & ~(1 << sw_i2c_data_gpio)); 422 + PEEK32(sw_i2c_data_gpio_mux_reg) & ~(1 << sw_i2c_data_gpio)); 433 423 434 424 /* Enable GPIO power */ 435 425 enableGPIO(1);