* [PATCH] softingcs: ret is never non-zero, so remove non-zero check and -ENODEV return
@ 2017-01-11 15:02 Colin King
2017-01-18 14:44 ` Marc Kleine-Budde
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-01-11 15:02 UTC (permalink / raw)
To: Wolfgang Grandegger, Marc Kleine-Budde, linux-can, netdev; +Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
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 <colin.king@canonical.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] softingcs: ret is never non-zero, so remove non-zero check and -ENODEV return
2017-01-11 15:02 [PATCH] softingcs: ret is never non-zero, so remove non-zero check and -ENODEV return Colin King
@ 2017-01-18 14:44 ` Marc Kleine-Budde
0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2017-01-18 14:44 UTC (permalink / raw)
To: Colin King, Wolfgang Grandegger, linux-can, netdev; +Cc: linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 697 bytes --]
On 01/11/2017 04:02 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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 <colin.king@canonical.com>
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 |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-18 14:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11 15:02 [PATCH] softingcs: ret is never non-zero, so remove non-zero check and -ENODEV return Colin King
2017-01-18 14:44 ` 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;
as well as URLs for NNTP newsgroup(s).