Linux wireless drivers development
 help / color / mirror / Atom feed
From: Malcolm Priestley <tvboxspy@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 2/2] staging: vt6656: rxtx.c s_vFillTxKey use switch for pTransmitKey->byCipherSuite
Date: Tue, 27 Aug 2013 12:32:01 +0100	[thread overview]
Message-ID: <1377603121.3320.84.camel@canaries32-MCP7A> (raw)


Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/rxtx.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index b5a9c3a..411189d 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -198,7 +198,8 @@ static void s_vFillTxKey(struct vnt_private *pDevice, u8 *pbyBuf,
 	*pdwIV = pDevice->dwIVCounter;
 	pDevice->byKeyIndex = pTransmitKey->dwKeyIndex & 0xf;
 
-	if (pTransmitKey->byCipherSuite == KEY_CTL_WEP) {
+	switch (pTransmitKey->byCipherSuite) {
+	case KEY_CTL_WEP:
 		if (pTransmitKey->uKeyLength == WLAN_WEP232_KEYLEN) {
 			memcpy(pDevice->abyPRNG, (u8 *)&dwRevIVCounter, 3);
 			memcpy(pDevice->abyPRNG + 3, pTransmitKey->abyKey,
@@ -223,7 +224,9 @@ static void s_vFillTxKey(struct vnt_private *pDevice, u8 *pbyBuf,
 		pDevice->dwIVCounter++;
 		if (pDevice->dwIVCounter > WEP_IV_MASK)
 			pDevice->dwIVCounter = 0;
-	} else if (pTransmitKey->byCipherSuite == KEY_CTL_TKIP) {
+
+		break;
+	case KEY_CTL_TKIP:
 		pTransmitKey->wTSC15_0++;
 		if (pTransmitKey->wTSC15_0 == 0)
 			pTransmitKey->dwTSC47_16++;
@@ -244,7 +247,8 @@ static void s_vFillTxKey(struct vnt_private *pDevice, u8 *pbyBuf,
 		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
 			"vFillTxKey()---- pdwExtIV: %x\n", *pdwExtIV);
 
-	} else if (pTransmitKey->byCipherSuite == KEY_CTL_CCMP) {
+		break;
+	case KEY_CTL_CCMP:
 		pTransmitKey->wTSC15_0++;
 		if (pTransmitKey->wTSC15_0 == 0)
 			pTransmitKey->dwTSC47_16++;
-- 
1.8.1.2


                 reply	other threads:[~2013-08-27 11:32 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=1377603121.3320.84.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