Commit 8781d5b3 authored by Fabian Frederick's avatar Fabian Frederick Committed by Greg Kroah-Hartman

staging: rtl8712: use swap() in dequeue_xframe_ex()

Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8a889aee
...@@ -188,7 +188,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv, ...@@ -188,7 +188,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
struct __queue *pframe_queue = NULL; struct __queue *pframe_queue = NULL;
struct xmit_frame *pxmitframe = NULL; struct xmit_frame *pxmitframe = NULL;
int i, inx[4]; int i, inx[4];
int j, tmp, acirp_cnt[4]; int j, acirp_cnt[4];
/*entry indx: 0->vo, 1->vi, 2->be, 3->bk.*/ /*entry indx: 0->vo, 1->vi, 2->be, 3->bk.*/
inx[0] = 0; acirp_cnt[0] = pxmitpriv->voq_cnt; inx[0] = 0; acirp_cnt[0] = pxmitpriv->voq_cnt;
...@@ -198,12 +198,8 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv, ...@@ -198,12 +198,8 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
for (j = i + 1; j < 4; j++) { for (j = i + 1; j < 4; j++) {
if (acirp_cnt[j] < acirp_cnt[i]) { if (acirp_cnt[j] < acirp_cnt[i]) {
tmp = acirp_cnt[i]; swap(acirp_cnt[i], acirp_cnt[j]);
acirp_cnt[i] = acirp_cnt[j]; swap(inx[i], inx[j]);
acirp_cnt[j] = tmp;
tmp = inx[i];
inx[i] = inx[j];
inx[j] = tmp;
} }
} }
} }
......
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