Skip to contentSkip to conversation

i2c: mv64xxx: fix indentation

PATCH Applied Antony Pavlov 3 participants 3 messages May 22, 2017 – May 23, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: mv64xxx: fix indentation

The patch fixes this compiler's warning:

    drivers/i2c/busses/i2c-mv64xxx.c: In function ‘mv64xxx_i2c_fsm’:
    drivers/i2c/busses/i2c-mv64xxx.c:303:3: warning: this ‘if’ clause does
    not guard... [-Wmisleading-indentation]
       if (drv_data->bytes_left == 1)
       ^~
    drivers/i2c/busses/i2c-mv64xxx.c:305:4: note: ...this statement, but the
    latter is misleadingly indented as if it is guarded by the ‘if’
        udelay(2);
        ^~~~~~
Cc Bastian Stender <[email protected]>
---
 drivers/i2c/busses/i2c-mv64xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-mv64xxx.c +1 -1
index 1a5d5ef9b..285ede84c 100644
@@ -302,7 +302,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
 
 		if (drv_data->bytes_left == 1)
 			drv_data->cntl_bits &= ~REG_CONTROL_ACK;
-			udelay(2);
+		udelay(2);
 		break;
 
 	case STATUS_MAST_RD_DATA_NO_ACK: /* 0x58 */
Signature · 7 lines
2.11.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw
Quoted 24 lines · Antony Pavlov

The patch fixes this compiler's warning:

    drivers/i2c/busses/i2c-mv64xxx.c: In function ‘mv64xxx_i2c_fsm’:
    drivers/i2c/busses/i2c-mv64xxx.c:303:3: warning: this ‘if’ clause does
    not guard... [-Wmisleading-indentation]
       if (drv_data->bytes_left == 1)
       ^~
    drivers/i2c/busses/i2c-mv64xxx.c:305:4: note: ...this statement, but the
    latter is misleadingly indented as if it is guarded by the ‘if’
        udelay(2);
        ^~~~~~
Cc Bastian Stender <[email protected]>
---
 drivers/i2c/busses/i2c-mv64xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-mv64xxx.c +0 -0
index 1a5d5ef9b..285ede84c 100644

drivers/i2c/busses/i2c-mv64xxx.c mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status) · line 308

Quoted 8 lines
drivers/i2c/busses/i2c-mv64xxx.c +1 -1
@@ -302,7 +302,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
 
 		if (drv_data->bytes_left == 1)
 			drv_data->cntl_bits &= ~REG_CONTROL_ACK;
-			udelay(2);
+		udelay(2);
 		break;
 
 	case STATUS_MAST_RD_DATA_NO_ACK: /* 0x58 */

Yes, the indentation happened accidentally. I just checked the functional spec again: the udelay is necessary regardless of drv_data->bytes_left.

Thanks.

Regards,
Bastian

Signature · 10 lines
Pengutronix e.K.
Industrial Linux Solutions
http://www.pengutronix.de/
Peiner Str. 6-8, 31137 Hildesheim, Germany
Amtsgericht Hildesheim, HRA 2686

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#2 lore raw
In reply to Antony Pavlov
Quoted 12 lines · Antony Pavlov

The patch fixes this compiler's warning:

    drivers/i2c/busses/i2c-mv64xxx.c: In function ‘mv64xxx_i2c_fsm’:
    drivers/i2c/busses/i2c-mv64xxx.c:303:3: warning: this ‘if’ clause does
    not guard... [-Wmisleading-indentation]
       if (drv_data->bytes_left == 1)
       ^~
    drivers/i2c/busses/i2c-mv64xxx.c:305:4: note: ...this statement, but the
    latter is misleadingly indented as if it is guarded by the ‘if’
        udelay(2);
        ^~~~~~
Quoted 2 lines
Cc Bastian Stender <[email protected]>

Applied, thanks

Sascha

Quoted 21 lines
---
 drivers/i2c/busses/i2c-mv64xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-mv64xxx.c +1 -1
index 1a5d5ef9b..285ede84c 100644
@@ -302,7 +302,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
 
 		if (drv_data->bytes_left == 1)
 			drv_data->cntl_bits &= ~REG_CONTROL_ACK;
-			udelay(2);
+		udelay(2);
 		break;
 
 	case STATUS_MAST_RD_DATA_NO_ACK: /* 0x58 */
Signature · 1 line
2.11.0
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox