diff options
author | Jelena Bjelja <jelena.bjelja.ing@gmail.com> | 2014-03-14 16:47:06 +0100 |
---|---|---|
committer | Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> | 2014-03-16 19:37:23 -0700 |
commit | e82efb2c11db8bd0ff57c7429e31c3da54e96454 (patch) | |
tree | c25dc89b15fbb2c413d5712b37194983f369d93f /drivers/staging/vt6655 | |
parent | cdf11154b6c61d1258d631ab1aed1a3018781340 (diff) | |
download | linux-e82efb2c11db8bd0ff57c7429e31c3da54e96454.tar.gz linux-e82efb2c11db8bd0ff57c7429e31c3da54e96454.tar.bz2 linux-e82efb2c11db8bd0ff57c7429e31c3da54e96454.zip |
staging: vt6655: Remove unnecessary braces in aes_ccmp.c
This patch fixes the checkpatch warnings:
WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: Jelena Bjelja <jelena.bjelja.ing@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Diffstat (limited to 'drivers/staging/vt6655')
-rw-r--r-- | drivers/staging/vt6655/aes_ccmp.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/drivers/staging/vt6655/aes_ccmp.c b/drivers/staging/vt6655/aes_ccmp.c index ed83de42f27b..4ccfe06481fc 100644 --- a/drivers/staging/vt6655/aes_ccmp.c +++ b/drivers/staging/vt6655/aes_ccmp.c @@ -152,9 +152,8 @@ static void SubBytes(unsigned char *in, unsigned char *out) { int i; - for (i = 0; i < 16; i++) { + for (i = 0; i < 16; i++) out[i] = sbox_table[in[i]]; - } } static void ShiftRows(unsigned char *in, unsigned char *out) @@ -309,13 +308,11 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor /* CCMP */ AESv128(pbyRxKey, MIC_IV, abyMIC); - for (kk = 0; kk < 16; kk++) { + for (kk = 0; kk < 16; kk++) abyTmp[kk] = MIC_HDR1[kk] ^ abyMIC[kk]; - } AESv128(pbyRxKey, abyTmp, abyMIC); - for (kk = 0; kk < 16; kk++) { + for (kk = 0; kk < 16; kk++) abyTmp[kk] = MIC_HDR2[kk] ^ abyMIC[kk]; - } AESv128(pbyRxKey, abyTmp, abyMIC); wCnt = 1; @@ -328,12 +325,10 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor AESv128(pbyRxKey, abyCTRPLD, abyTmp); - for (kk = 0; kk < 16; kk++) { + for (kk = 0; kk < 16; kk++) abyPlainText[kk] = abyTmp[kk] ^ pbyPayload[kk]; - } - for (kk = 0; kk < 16; kk++) { + for (kk = 0; kk < 16; kk++) abyTmp[kk] = abyMIC[kk] ^ abyPlainText[kk]; - } AESv128(pbyRxKey, abyTmp, abyMIC); memcpy(pbyPayload, abyPlainText, 16); @@ -343,27 +338,23 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor /* last payload */ memcpy(&(abyLastCipher[0]), pbyPayload, jj); - for (ii = jj; ii < 16; ii++) { + for (ii = jj; ii < 16; ii++) abyLastCipher[ii] = 0x00; - } abyCTRPLD[14] = (unsigned char)(wCnt >> 8); abyCTRPLD[15] = (unsigned char)(wCnt & 0xff); AESv128(pbyRxKey, abyCTRPLD, abyTmp); - for (kk = 0; kk < 16; kk++) { + for (kk = 0; kk < 16; kk++) abyPlainText[kk] = abyTmp[kk] ^ abyLastCipher[kk]; - } memcpy(pbyPayload, abyPlainText, jj); pbyPayload += jj; /* for MIC calculation */ - for (ii = jj; ii < 16; ii++) { + for (ii = jj; ii < 16; ii++) abyPlainText[ii] = 0x00; - } - for (kk = 0; kk < 16; kk++) { + for (kk = 0; kk < 16; kk++) abyTmp[kk] = abyMIC[kk] ^ abyPlainText[kk]; - } AESv128(pbyRxKey, abyTmp, abyMIC); /* =>above is the calculate MIC */ @@ -373,9 +364,8 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor abyCTRPLD[14] = (unsigned char)(wCnt >> 8); abyCTRPLD[15] = (unsigned char)(wCnt & 0xff); AESv128(pbyRxKey, abyCTRPLD, abyTmp); - for (kk = 0; kk < 8; kk++) { + for (kk = 0; kk < 8; kk++) abyTmp[kk] = abyTmp[kk] ^ pbyPayload[kk]; - } /* =>above is the dec-MIC from packet */ /* -------------------------------------------- */ |