Commit 42ceb673 authored by Nishka Dasgupta's avatar Nishka Dasgupta Committed by Greg Kroah-Hartman

staging: rtl8712: init_mp_priv(): Change return values

Change return values of init_mp_priv from _SUCCESS/_FAIL to 0/-ENOMEM
respectively.
Remove label that returns the required value and return the values
directly as they are set.
Consequently remove now-unnecessary return variable.
Signed-off-by: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-5-nishkadg.linux@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c93fdf0
...@@ -35,7 +35,7 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv) ...@@ -35,7 +35,7 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv)
static int init_mp_priv(struct mp_priv *pmp_priv) static int init_mp_priv(struct mp_priv *pmp_priv)
{ {
int i, res; int i;
struct mp_xmit_frame *pmp_xmitframe; struct mp_xmit_frame *pmp_xmitframe;
_init_mp_priv_(pmp_priv); _init_mp_priv_(pmp_priv);
...@@ -45,8 +45,7 @@ static int init_mp_priv(struct mp_priv *pmp_priv) ...@@ -45,8 +45,7 @@ static int init_mp_priv(struct mp_priv *pmp_priv)
sizeof(struct mp_xmit_frame) + 4, sizeof(struct mp_xmit_frame) + 4,
GFP_ATOMIC); GFP_ATOMIC);
if (!pmp_priv->pallocated_mp_xmitframe_buf) { if (!pmp_priv->pallocated_mp_xmitframe_buf) {
res = _FAIL; return -ENOMEM;
goto _exit_init_mp_priv;
} }
pmp_priv->pmp_xmtframe_buf = pmp_priv->pallocated_mp_xmitframe_buf + pmp_priv->pmp_xmtframe_buf = pmp_priv->pallocated_mp_xmitframe_buf +
4 - 4 -
...@@ -62,9 +61,7 @@ static int init_mp_priv(struct mp_priv *pmp_priv) ...@@ -62,9 +61,7 @@ static int init_mp_priv(struct mp_priv *pmp_priv)
pmp_xmitframe++; pmp_xmitframe++;
} }
pmp_priv->free_mp_xmitframe_cnt = NR_MP_XMITFRAME; pmp_priv->free_mp_xmitframe_cnt = NR_MP_XMITFRAME;
res = _SUCCESS; return 0;
_exit_init_mp_priv:
return res;
} }
static int free_mp_priv(struct mp_priv *pmp_priv) static int free_mp_priv(struct mp_priv *pmp_priv)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment