Commit 19c74ea5 authored by Ivan Safonov's avatar Ivan Safonov Committed by Greg Kroah-Hartman

staging: r8188eu: refactor recvframe_defrag()

Local variables pfhdr and prframe always have a same value,
so one of them is unnecessary.
Signed-off-by: default avatarIvan Safonov <insafonov@gmail.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 737e0615
...@@ -1325,7 +1325,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, ...@@ -1325,7 +1325,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,
struct list_head *plist, *phead; struct list_head *plist, *phead;
u8 wlanhdr_offset; u8 wlanhdr_offset;
u8 curfragnum; u8 curfragnum;
struct recv_frame *pfhdr, *pnfhdr; struct recv_frame *pnfhdr;
struct recv_frame *prframe, *pnextrframe; struct recv_frame *prframe, *pnextrframe;
struct __queue *pfree_recv_queue; struct __queue *pfree_recv_queue;
...@@ -1334,11 +1334,10 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, ...@@ -1334,11 +1334,10 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,
phead = get_list_head(defrag_q); phead = get_list_head(defrag_q);
plist = phead->next; plist = phead->next;
pfhdr = list_entry(plist, struct recv_frame, list); prframe = list_entry(plist, struct recv_frame, list);
prframe = pfhdr;
list_del_init(&prframe->list); list_del_init(&prframe->list);
if (curfragnum != pfhdr->attrib.frag_num) { if (curfragnum != prframe->attrib.frag_num) {
/* the first fragment number must be 0 */ /* the first fragment number must be 0 */
/* free the whole queue */ /* free the whole queue */
rtw_free_recvframe(prframe, pfree_recv_queue); rtw_free_recvframe(prframe, pfree_recv_queue);
...@@ -1377,15 +1376,15 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, ...@@ -1377,15 +1376,15 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,
skb_pull(pnextrframe->pkt, wlanhdr_offset); skb_pull(pnextrframe->pkt, wlanhdr_offset);
/* append to first fragment frame's tail (if privacy frame, pull the ICV) */ /* append to first fragment frame's tail (if privacy frame, pull the ICV) */
skb_trim(prframe->pkt, prframe->pkt->len - pfhdr->attrib.icv_len); skb_trim(prframe->pkt, prframe->pkt->len - prframe->attrib.icv_len);
/* memcpy */ /* memcpy */
memcpy(skb_tail_pointer(pfhdr->pkt), pnfhdr->pkt->data, memcpy(skb_tail_pointer(prframe->pkt), pnfhdr->pkt->data,
pnfhdr->pkt->len); pnfhdr->pkt->len);
skb_put(prframe->pkt, pnfhdr->pkt->len); skb_put(prframe->pkt, pnfhdr->pkt->len);
pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len; prframe->attrib.icv_len = pnfhdr->attrib.icv_len;
plist = plist->next; plist = plist->next;
} }
......
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