Subject: [PATCH 12/12] batman-adv: Remove unnecessary ret variable in algo_register

From: Antonio Quartulli <[email-masked]>
Date: Wed, 3 Jun 2015 16:14:08 +0200

From: Markus Pargmann <[email-masked]>

Remove ret variable and all jumps.

Signed-off-by: Markus Pargmann <[email-masked]>
Signed-off-by: Marek Lindner <[email-masked]>
Signed-off-by: Antonio Quartulli <[email-masked]>
---
 net/batman-adv/main.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 49f07e1..548e405 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -544,17 +544,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)
-- 
2.4.2