batman-adv: Remove unnecessary ret variable in algo_register
authorMarkus Pargmann <mpa@pengutronix.de>
Fri, 26 Dec 2014 11:41:41 +0000 (12:41 +0100)
committerAntonio Quartulli <antonio@meshcoding.com>
Wed, 3 Jun 2015 13:57:25 +0000 (15:57 +0200)
Remove ret variable and all jumps.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
net/batman-adv/main.c

index 49f07e1e0f5fa17fa2f4e526b5c01240bcc51970..548e405d13c100a144affa3a47e25675cc4bd119 100644 (file)
@@ -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)