2022-08-31 16:32:45

by CGEL

[permalink] [raw]
Subject: [PATCH linux-next] can: sja1000: remove redundant variable ret

From: Jinpeng Cui <[email protected]>

Return value directly from register_candev() instead of
getting value from redundant variable ret.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Jinpeng Cui <[email protected]>
---
drivers/net/can/sja1000/sja1000.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 98dfd5f295a7..1bb1129b0450 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -661,8 +661,6 @@ static const struct ethtool_ops sja1000_ethtool_ops = {

int register_sja1000dev(struct net_device *dev)
{
- int ret;
-
if (!sja1000_probe_chip(dev))
return -ENODEV;

@@ -673,9 +671,7 @@ int register_sja1000dev(struct net_device *dev)
set_reset_mode(dev);
chipset_init(dev);

- ret = register_candev(dev);
-
- return ret;
+ return register_candev(dev);
}
EXPORT_SYMBOL_GPL(register_sja1000dev);

--
2.25.1


2022-09-05 16:33:01

by Marc Kleine-Budde

[permalink] [raw]
Subject: Re: [PATCH linux-next] can: sja1000: remove redundant variable ret

On 31.08.2022 16:18:35, [email protected] wrote:
> From: Jinpeng Cui <[email protected]>
>
> Return value directly from register_candev() instead of
> getting value from redundant variable ret.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: Jinpeng Cui <[email protected]>

Applied to linux-can-next.

Thanks,
Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |


Attachments:
(No filename) (632.00 B)
signature.asc (499.00 B)
Download all attachments