diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2013-08-27 06:48:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-27 19:54:39 -0400 |
commit | 27df3ebf363bc1a63ab2356975848a07fb2229dc (patch) | |
tree | 73e27f02cd620936789a9166630e00955c7e13da | |
parent | 43e48a4a8bc7a2f68c3bd932739e927851aec7a1 (diff) |
staging: vt6656: s_vFillCTSHead join structures of vnt_cts* to union vnt_tx_data_head
Only one of vnt_rts*/vnt_cts* structures are accessed at any one time.
structures vnt_cts and vnt_cts_fb are members of union vnt_tx_data_head.
Create pointer union head and point structures to the correct member.
Point the union to pvCTS.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/vt6656/rxtx.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 98224bc3ea5f..fd3c59824152 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c | |||
@@ -760,15 +760,15 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx, | |||
760 | u8 byPktType, void *pvCTS, u32 cbFrameLength, int bNeedAck, | 760 | u8 byPktType, void *pvCTS, u32 cbFrameLength, int bNeedAck, |
761 | u16 wCurrentRate, u8 byFBOption) | 761 | u16 wCurrentRate, u8 byFBOption) |
762 | { | 762 | { |
763 | union vnt_tx_data_head *head = pvCTS; | ||
763 | u32 uCTSFrameLen = 14; | 764 | u32 uCTSFrameLen = 14; |
764 | 765 | ||
765 | if (pvCTS == NULL) { | 766 | if (!head) |
766 | return; | 767 | return; |
767 | } | ||
768 | 768 | ||
769 | if (byFBOption != AUTO_FB_NONE) { | 769 | if (byFBOption != AUTO_FB_NONE) { |
770 | /* Auto Fall back */ | 770 | /* Auto Fall back */ |
771 | struct vnt_cts_fb *pBuf = (struct vnt_cts_fb *)pvCTS; | 771 | struct vnt_cts_fb *pBuf = &head->cts_g_fb; |
772 | /* Get SignalField,ServiceField,Length */ | 772 | /* Get SignalField,ServiceField,Length */ |
773 | BBvCalculateParameter(pDevice, uCTSFrameLen, | 773 | BBvCalculateParameter(pDevice, uCTSFrameLen, |
774 | pDevice->byTopCCKBasicRate, PK_TYPE_11B, &pBuf->b); | 774 | pDevice->byTopCCKBasicRate, PK_TYPE_11B, &pBuf->b); |
@@ -788,7 +788,7 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx, | |||
788 | pBuf->data.frame_control = TYPE_CTL_CTS; | 788 | pBuf->data.frame_control = TYPE_CTL_CTS; |
789 | memcpy(pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN); | 789 | memcpy(pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN); |
790 | } else { | 790 | } else { |
791 | struct vnt_cts *pBuf = (struct vnt_cts *)pvCTS; | 791 | struct vnt_cts *pBuf = &head->cts_g; |
792 | /* Get SignalField,ServiceField,Length */ | 792 | /* Get SignalField,ServiceField,Length */ |
793 | BBvCalculateParameter(pDevice, uCTSFrameLen, | 793 | BBvCalculateParameter(pDevice, uCTSFrameLen, |
794 | pDevice->byTopCCKBasicRate, PK_TYPE_11B, &pBuf->b); | 794 | pDevice->byTopCCKBasicRate, PK_TYPE_11B, &pBuf->b); |