mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] can: mcp251xfd: remove useless code in mcp251xfd_chip_softreset
@ 2020-11-17  9:29 xiakaixu1987
  2020-11-17 10:05 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: xiakaixu1987 @ 2020-11-17  9:29 UTC (permalink / raw)
  To: mkl, manivannan.sadhasivam, thomas.kopp, wg, kuba
  Cc: linux-can, netdev, linux-kernel, Kaixu Xia

From: Kaixu Xia <kaixuxia@tencent.com>

It would directly return if the variable err equals to 0 or other errors.
Only when the err equals to -ETIMEDOUT it can reach the 'if (err)'
statement, so the 'if (err)' and last 'return -ETIMEDOUT' statements are
useless. Romove them.

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 9c215f7c5f81..ceae18270c01 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -644,10 +644,7 @@ static int mcp251xfd_chip_softreset(const struct mcp251xfd_priv *priv)
 		return 0;
 	}
 
-	if (err)
-		return err;
-
-	return -ETIMEDOUT;
+	return err;
 }
 
 static int mcp251xfd_chip_clock_init(const struct mcp251xfd_priv *priv)
-- 
2.20.0


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

end of thread, other threads:[~2020-11-17 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17  9:29 [PATCH] can: mcp251xfd: remove useless code in mcp251xfd_chip_softreset xiakaixu1987
2020-11-17 10:05 ` Marc Kleine-Budde

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

all inboxes | Powered by JetHome®