mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] i2c: mv64xxx: fix indentation
@ 2017-05-22 13:29 Antony Pavlov
  2017-05-22 13:49 ` Bastian Stender
  2017-05-23  8:02 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Antony Pavlov @ 2017-05-22 13:29 UTC (permalink / raw)
  To: barebox; +Cc: Bastian Stender

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);
        ^~~~~~

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Bastian Stender <bst@pengutronix.de>
---
 drivers/i2c/busses/i2c-mv64xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 1a5d5ef9b..285ede84c 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -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 */
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c: mv64xxx: fix indentation
  2017-05-22 13:29 [PATCH] i2c: mv64xxx: fix indentation Antony Pavlov
@ 2017-05-22 13:49 ` Bastian Stender
  2017-05-23  8:02 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Bastian Stender @ 2017-05-22 13:49 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On 05/22/2017 03:29 PM, Antony Pavlov wrote:
> 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);
>         ^~~~~~
>
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> Cc: Bastian Stender <bst@pengutronix.de>
> ---
>  drivers/i2c/busses/i2c-mv64xxx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
> index 1a5d5ef9b..285ede84c 100644
> --- a/drivers/i2c/busses/i2c-mv64xxx.c
> +++ b/drivers/i2c/busses/i2c-mv64xxx.c
> @@ -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

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

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c: mv64xxx: fix indentation
  2017-05-22 13:29 [PATCH] i2c: mv64xxx: fix indentation Antony Pavlov
  2017-05-22 13:49 ` Bastian Stender
@ 2017-05-23  8:02 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2017-05-23  8:02 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox, Bastian Stender

On Mon, May 22, 2017 at 04:29:34PM +0300, Antony Pavlov wrote:
> 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);
>         ^~~~~~
> 
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> Cc: Bastian Stender <bst@pengutronix.de>

Applied, thanks

Sascha

> ---
>  drivers/i2c/busses/i2c-mv64xxx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
> index 1a5d5ef9b..285ede84c 100644
> --- a/drivers/i2c/busses/i2c-mv64xxx.c
> +++ b/drivers/i2c/busses/i2c-mv64xxx.c
> @@ -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 */
> -- 
> 2.11.0
> 
> 

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-23  8:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 13:29 [PATCH] i2c: mv64xxx: fix indentation Antony Pavlov
2017-05-22 13:49 ` Bastian Stender
2017-05-23  8:02 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox