batman-adv: iv_ogm_iface_enable, direct return values
authorMarkus Pargmann <mpa@pengutronix.de>
Fri, 26 Dec 2014 11:41:26 +0000 (12:41 +0100)
committerAntonio Quartulli <antonio@meshcoding.com>
Fri, 29 May 2015 08:13:36 +0000 (10:13 +0200)
Directly return error values. No need to use a return variable.

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

index fc299c03a4384677406ed3cc2d1bb698b1563f36..123aabbcb003ec7bd52fc212b93f0ebf5e8b5d1f 100644 (file)
@@ -308,7 +308,6 @@ static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface)
        struct batadv_ogm_packet *batadv_ogm_packet;
        unsigned char *ogm_buff;
        uint32_t random_seqno;
-       int res = -ENOMEM;
 
        /* randomize initial seqno to avoid collision */
        get_random_bytes(&random_seqno, sizeof(random_seqno));
@@ -317,7 +316,7 @@ static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface)
        hard_iface->bat_iv.ogm_buff_len = BATADV_OGM_HLEN;
        ogm_buff = kmalloc(hard_iface->bat_iv.ogm_buff_len, GFP_ATOMIC);
        if (!ogm_buff)
-               goto out;
+               return -ENOMEM;
 
        hard_iface->bat_iv.ogm_buff = ogm_buff;
 
@@ -329,10 +328,7 @@ static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface)
        batadv_ogm_packet->reserved = 0;
        batadv_ogm_packet->tq = BATADV_TQ_MAX_VALUE;
 
-       res = 0;
-
-out:
-       return res;
+       return 0;
 }
 
 static void batadv_iv_ogm_iface_disable(struct batadv_hard_iface *hard_iface)