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

staging: rtl8712: _r8712_init_xmit_priv(): Change return values and type

Change the return values in _r8712_init_xmit_priv from _SUCCESS/_FAIL to
0/-ENOMEM respectively. Change return type from sint to int.
Signed-off-by: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190809052353.5308-1-nishkadg.linux@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 133716f4
...@@ -49,7 +49,7 @@ void _r8712_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv) ...@@ -49,7 +49,7 @@ void _r8712_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv)
INIT_LIST_HEAD(&psta_xmitpriv->apsd); INIT_LIST_HEAD(&psta_xmitpriv->apsd);
} }
sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv, int _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
struct _adapter *padapter) struct _adapter *padapter)
{ {
sint i; sint i;
...@@ -79,7 +79,7 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv, ...@@ -79,7 +79,7 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
kmalloc(NR_XMITFRAME * sizeof(struct xmit_frame) + 4, GFP_ATOMIC); kmalloc(NR_XMITFRAME * sizeof(struct xmit_frame) + 4, GFP_ATOMIC);
if (!pxmitpriv->pallocated_frame_buf) { if (!pxmitpriv->pallocated_frame_buf) {
pxmitpriv->pxmit_frame_buf = NULL; pxmitpriv->pxmit_frame_buf = NULL;
return _FAIL; return -ENOMEM;
} }
pxmitpriv->pxmit_frame_buf = pxmitpriv->pallocated_frame_buf + 4 - pxmitpriv->pxmit_frame_buf = pxmitpriv->pallocated_frame_buf + 4 -
((addr_t) (pxmitpriv->pallocated_frame_buf) & 3); ((addr_t) (pxmitpriv->pallocated_frame_buf) & 3);
...@@ -119,7 +119,7 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv, ...@@ -119,7 +119,7 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
if (!pxmitpriv->pallocated_xmitbuf) { if (!pxmitpriv->pallocated_xmitbuf) {
kfree(pxmitpriv->pallocated_frame_buf); kfree(pxmitpriv->pallocated_frame_buf);
pxmitpriv->pallocated_frame_buf = NULL; pxmitpriv->pallocated_frame_buf = NULL;
return _FAIL; return -ENOMEM;
} }
pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 -
((addr_t)(pxmitpriv->pallocated_xmitbuf) & 3); ((addr_t)(pxmitpriv->pallocated_xmitbuf) & 3);
...@@ -129,12 +129,12 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv, ...@@ -129,12 +129,12 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
pxmitbuf->pallocated_buf = kmalloc(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ, pxmitbuf->pallocated_buf = kmalloc(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ,
GFP_ATOMIC); GFP_ATOMIC);
if (!pxmitbuf->pallocated_buf) if (!pxmitbuf->pallocated_buf)
return _FAIL; return -ENOMEM;
pxmitbuf->pbuf = pxmitbuf->pallocated_buf + XMITBUF_ALIGN_SZ - pxmitbuf->pbuf = pxmitbuf->pallocated_buf + XMITBUF_ALIGN_SZ -
((addr_t) (pxmitbuf->pallocated_buf) & ((addr_t) (pxmitbuf->pallocated_buf) &
(XMITBUF_ALIGN_SZ - 1)); (XMITBUF_ALIGN_SZ - 1));
if (r8712_xmit_resource_alloc(padapter, pxmitbuf)) if (r8712_xmit_resource_alloc(padapter, pxmitbuf))
return _FAIL; return -ENOMEM;
list_add_tail(&pxmitbuf->list, list_add_tail(&pxmitbuf->list,
&(pxmitpriv->free_xmitbuf_queue.queue)); &(pxmitpriv->free_xmitbuf_queue.queue));
pxmitbuf++; pxmitbuf++;
...@@ -146,7 +146,7 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv, ...@@ -146,7 +146,7 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
tasklet_init(&pxmitpriv->xmit_tasklet, tasklet_init(&pxmitpriv->xmit_tasklet,
(void(*)(unsigned long))r8712_xmit_bh, (void(*)(unsigned long))r8712_xmit_bh,
(unsigned long)padapter); (unsigned long)padapter);
return _SUCCESS; return 0;
} }
void _free_xmit_priv(struct xmit_priv *pxmitpriv) void _free_xmit_priv(struct xmit_priv *pxmitpriv)
......
...@@ -268,7 +268,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt, ...@@ -268,7 +268,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
struct pkt_attrib *pattrib); struct pkt_attrib *pattrib);
int r8712_txframes_sta_ac_pending(struct _adapter *padapter, int r8712_txframes_sta_ac_pending(struct _adapter *padapter,
struct pkt_attrib *pattrib); struct pkt_attrib *pattrib);
sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv, int _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
struct _adapter *padapter); struct _adapter *padapter);
void _free_xmit_priv(struct xmit_priv *pxmitpriv); void _free_xmit_priv(struct xmit_priv *pxmitpriv);
void r8712_free_xmitframe_ex(struct xmit_priv *pxmitpriv, void r8712_free_xmitframe_ex(struct xmit_priv *pxmitpriv,
......
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