[PATCH] softingcs: ret is never non-zero, so remove non-zero check and -ENODEV return

Subsystems: can network drivers, the rest

STALE3503d

2 messages, 2 authors, 2017-01-18 · open the first message on its own page

[PATCH] softingcs: ret is never non-zero, so remove non-zero check and -ENODEV return

From: Colin King <hidden>
Date: 2017-01-11 15:03:42

From: Colin Ian King <redacted>

The error return ret is never zero in the error handling path in
softingcs_probe, so the check for non-zero and returning -ENODEV
is logically dead code and hence redundant.  Remove it and just
return ret.

Signed-off-by: Colin Ian King <redacted>
---
 drivers/net/can/softing/softing_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/softing/softing_cs.c b/drivers/net/can/softing/softing_cs.c
index cdc0c74..4d44928 100644
--- a/drivers/net/can/softing/softing_cs.c
+++ b/drivers/net/can/softing/softing_cs.c
@@ -310,7 +310,7 @@ static int softingcs_probe(struct pcmcia_device *pcmcia)
 pcmcia_failed:
 	pcmcia_disable_device(pcmcia);
 	pcmcia->priv = NULL;
-	return ret ?: -ENODEV;
+	return ret;
 }
 
 static const struct pcmcia_device_id softingcs_ids[] = {
-- 
2.10.2

Re: [PATCH] softingcs: ret is never non-zero, so remove non-zero check and -ENODEV return

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2017-01-18 14:45:02

On 01/11/2017 04:02 PM, Colin King wrote:
From: Colin Ian King <redacted>

The error return ret is never zero in the error handling path in
softingcs_probe, so the check for non-zero and returning -ENODEV
is logically dead code and hence redundant.  Remove it and just
return ret.

Signed-off-by: Colin Ian King <redacted>
Thanks, applied to can-next.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help