i2c: xiic: Remove some dead code

Message ID 9d36938de98dc491425a51a9c07367dd9e448e60.1676457464.git.christophe.jaillet@wanadoo.fr
State New
Headers
Series i2c: xiic: Remove some dead code |

Commit Message

Christophe JAILLET Feb. 15, 2023, 10:38 a.m. UTC
  wait_for_completion_timeout() never returns negative value.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/i2c/busses/i2c-xiic.c | 4 ----
 1 file changed, 4 deletions(-)
  

Comments

Michal Simek Feb. 16, 2023, 9:12 a.m. UTC | #1
On 2/15/23 11:38, Christophe JAILLET wrote:
> 
> wait_for_completion_timeout() never returns negative value.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   drivers/i2c/busses/i2c-xiic.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index 8503b5016aaf..5543f372ae60 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -1038,10 +1038,6 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
>                  i2c->rx_msg = NULL;
>                  i2c->nmsgs = 0;
>                  err = -ETIMEDOUT;
> -       } else if (err < 0) {   /* Completion error */
> -               i2c->tx_msg = NULL;
> -               i2c->rx_msg = NULL;
> -               i2c->nmsgs = 0;
>          } else {
>                  err = (i2c->state == STATE_DONE) ? num : -EIO;
>          }
> --
> 2.34.1
> 

Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal
  
Wolfram Sang Feb. 17, 2023, 9:46 p.m. UTC | #2
On Wed, Feb 15, 2023 at 11:38:07AM +0100, Christophe JAILLET wrote:
> wait_for_completion_timeout() never returns negative value.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied to for-next, thanks!
  

Patch

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 8503b5016aaf..5543f372ae60 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1038,10 +1038,6 @@  static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 		i2c->rx_msg = NULL;
 		i2c->nmsgs = 0;
 		err = -ETIMEDOUT;
-	} else if (err < 0) {	/* Completion error */
-		i2c->tx_msg = NULL;
-		i2c->rx_msg = NULL;
-		i2c->nmsgs = 0;
 	} else {
 		err = (i2c->state == STATE_DONE) ? num : -EIO;
 	}