[v2,09/26] batman-adv: iv_ogm_iface_enable, direct return values
Commit Message
Directly return error values. No need to use a return variable.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
bat_iv_ogm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
Comments
On Friday 26 December 2014 12:41:26 Markus Pargmann wrote:
> Directly return error values. No need to use a return variable.
>
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> ---
> bat_iv_ogm.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
Applied in revision 0cc4569.
Thanks,
Marek
@@ -310,7 +310,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));
@@ -319,7 +318,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;
@@ -331,10 +330,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)