From: Malcolm Priestley <tvboxspy@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 2/5] staging: vt6656: s_vFillCTSHead join structures of vnt_cts* to union vnt_tx_data_head
Date: Tue, 27 Aug 2013 11:48:34 +0100 [thread overview]
Message-ID: <1377600514.3320.61.camel@canaries32-MCP7A> (raw)
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>
---
drivers/staging/vt6656/rxtx.c | 10 +++++-----From 3deb77d380b80ff3cf719efc96f33ca27c8ad29c Mon Sep 17 00:00:00 2001
From: Malcolm Priestley <tvboxspy@gmail.com>
Date: Sun, 25 Aug 2013 10:08:13 +0100
Subject: [PATCH 04/13] staging: vt6656: s_vFillCTSHead add union
vnt_tx_data_head
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 98224bc..fd3c598 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,
u8 byPktType, void *pvCTS, u32 cbFrameLength, int bNeedAck,
u16 wCurrentRate, u8 byFBOption)
{
+ union vnt_tx_data_head *head = pvCTS;
u32 uCTSFrameLen = 14;
- if (pvCTS == NULL) {
- return;
- }
+ if (!head)
+ return;
if (byFBOption != AUTO_FB_NONE) {
/* Auto Fall back */
- struct vnt_cts_fb *pBuf = (struct vnt_cts_fb *)pvCTS;
+ struct vnt_cts_fb *pBuf = &head->cts_g_fb;
/* Get SignalField,ServiceField,Length */
BBvCalculateParameter(pDevice, uCTSFrameLen,
pDevice->byTopCCKBasicRate, PK_TYPE_11B, &pBuf->b);
@@ -788,7 +788,7 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx,
pBuf->data.frame_control = TYPE_CTL_CTS;
memcpy(pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN);
} else {
- struct vnt_cts *pBuf = (struct vnt_cts *)pvCTS;
+ struct vnt_cts *pBuf = &head->cts_g;
/* Get SignalField,ServiceField,Length */
BBvCalculateParameter(pDevice, uCTSFrameLen,
pDevice->byTopCCKBasicRate, PK_TYPE_11B, &pBuf->b);
--
1.8.1.2
reply other threads:[~2013-08-27 10:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1377600514.3320.61.camel@canaries32-MCP7A \
--to=tvboxspy@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox