diff mbox series

[3/3] spi: spi.c: Remove redundant else block

Message ID 20220629142519.3985486-4-david@protonic.nl (mailing list archive)
State Accepted
Commit 31d4c1bdf157421b26d51f61a4da95dd20d171e2
Headers show
Series Fix some coding style issues | expand

Commit Message

David Jander June 29, 2022, 2:25 p.m. UTC
Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: David Jander <david@protonic.nl>
---
 drivers/spi/spi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

David Jander June 29, 2022, 2:28 p.m. UTC | #1
On Wed, 29 Jun 2022 16:25:19 +0200
David Jander <david@protonic.nl> wrote:

> Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: David Jander <david@protonic.nl>
> ---
>  drivers/spi/spi.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 09d4959bc09c..dc1a324e3271 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -1636,13 +1636,13 @@ static int __spi_pump_transfer_message(struct spi_controller *ctlr,
>  		dev_err(&ctlr->dev,
>  			"failed to transfer one message from queue\n");
>  		return ret;
> -	} else {
> -		WRITE_ONCE(ctlr->cur_msg_need_completion, true);
> -		smp_mb(); /* see spi_finalize_current_message()... */
> -		if (READ_ONCE(ctlr->cur_msg_incomplete))
> -			wait_for_completion(&ctlr->cur_msg_completion);
>  	}
>  
> +	WRITE_ONCE(ctlr->cur_msg_need_completion, true);
> +	smp_mb(); /* See spi_finalize_current_message()... */

Argh. Just noticed that this comment fix slipped into the wrong patch.
Do I need to re-submit, or is this acceptable?

> +	if (READ_ONCE(ctlr->cur_msg_incomplete))
> +		wait_for_completion(&ctlr->cur_msg_completion);
> +
>  	return 0;
>  }
>  

Best regards,
Mark Brown June 29, 2022, 2:34 p.m. UTC | #2
On Wed, Jun 29, 2022 at 04:28:57PM +0200, David Jander wrote:
> David Jander <david@protonic.nl> wrote:

> > +	WRITE_ONCE(ctlr->cur_msg_need_completion, true);
> > +	smp_mb(); /* See spi_finalize_current_message()... */

> Argh. Just noticed that this comment fix slipped into the wrong patch.
> Do I need to re-submit, or is this acceptable?

It's fine, leave it unless you need to resend for some other reason.
diff mbox series

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 09d4959bc09c..dc1a324e3271 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1636,13 +1636,13 @@  static int __spi_pump_transfer_message(struct spi_controller *ctlr,
 		dev_err(&ctlr->dev,
 			"failed to transfer one message from queue\n");
 		return ret;
-	} else {
-		WRITE_ONCE(ctlr->cur_msg_need_completion, true);
-		smp_mb(); /* see spi_finalize_current_message()... */
-		if (READ_ONCE(ctlr->cur_msg_incomplete))
-			wait_for_completion(&ctlr->cur_msg_completion);
 	}
 
+	WRITE_ONCE(ctlr->cur_msg_need_completion, true);
+	smp_mb(); /* See spi_finalize_current_message()... */
+	if (READ_ONCE(ctlr->cur_msg_incomplete))
+		wait_for_completion(&ctlr->cur_msg_completion);
+
 	return 0;
 }