[v2,24/26] batman-adv: Remove unnecessary ret variable in algo_register

Message ID 1419594103-10928-25-git-send-email-mpa@pengutronix.de (mailing list archive)
State Accepted, archived
Headers

Commit Message

Markus Pargmann Dec. 26, 2014, 11:41 a.m. UTC
  Remove ret variable and all jumps.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 main.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
  

Comments

Marek Lindner March 13, 2015, 6:06 a.m. UTC | #1
On Friday, December 26, 2014 12:41:41 Markus Pargmann wrote:
> Remove ret variable and all jumps.
> 
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> ---
>  main.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Applied in revision 16b4833.

Thanks,
Marek
  

Patch

diff --git a/main.c b/main.c
index 2e2ad071a085..d67be132e5df 100644
--- a/main.c
+++ b/main.c
@@ -563,17 +563,14 @@  int batadv_algo_register(struct batadv_algo_ops *bat_algo_ops)
 int batadv_algo_select(struct batadv_priv *bat_priv, char *name)
 {
 	struct batadv_algo_ops *bat_algo_ops;
-	int ret = -EINVAL;
 
 	bat_algo_ops = batadv_algo_get(name);
 	if (!bat_algo_ops)
-		goto out;
+		return -EINVAL;
 
 	bat_priv->bat_algo_ops = bat_algo_ops;
-	ret = 0;
 
-out:
-	return ret;
+	return 0;
 }
 
 int batadv_algo_seq_print_text(struct seq_file *seq, void *offset)