linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: hix5hd2: remove some dead code
@ 2018-05-09 19:46 Peter Rosin
  2018-05-14 22:12 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Rosin @ 2018-05-09 19:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Masahiro Yamada, Andy Shevchenko, linux-i2c

The else branch cannot be taken as i will always equal num.
Get rid of the whole construct.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/busses/i2c-hix5hd2.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/i2c/busses/i2c-hix5hd2.c b/drivers/i2c/busses/i2c-hix5hd2.c
index bb68957d3da5..190b250e6834 100644
--- a/drivers/i2c/busses/i2c-hix5hd2.c
+++ b/drivers/i2c/busses/i2c-hix5hd2.c
@@ -377,17 +377,7 @@ static int hix5hd2_i2c_xfer(struct i2c_adapter *adap,
 			goto out;
 	}
 
-	if (i == num) {
-		ret = num;
-	} else {
-		/* Only one message, cannot access the device */
-		if (i == 1)
-			ret = -EREMOTEIO;
-		else
-			ret = i;
-
-		dev_warn(priv->dev, "xfer message failed\n");
-	}
+	ret = num;
 
 out:
 	pm_runtime_mark_last_busy(priv->dev);
-- 
2.11.0

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

* Re: [PATCH] i2c: hix5hd2: remove some dead code
  2018-05-09 19:46 [PATCH] i2c: hix5hd2: remove some dead code Peter Rosin
@ 2018-05-14 22:12 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2018-05-14 22:12 UTC (permalink / raw)
  To: Peter Rosin; +Cc: linux-kernel, Masahiro Yamada, Andy Shevchenko, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

On Wed, May 09, 2018 at 09:46:03PM +0200, Peter Rosin wrote:
> The else branch cannot be taken as i will always equal num.
> Get rid of the whole construct.
> 
> Signed-off-by: Peter Rosin <peda@axentia.se>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2018-05-14 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09 19:46 [PATCH] i2c: hix5hd2: remove some dead code Peter Rosin
2018-05-14 22:12 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).