diff options
author | Joe Perches <joe@perches.com> | 2014-08-17 09:17:04 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-17 09:43:50 -0700 |
commit | 48caf5a060491edb2e1793539dad72e70c54c869 (patch) | |
tree | 27be414ac8303a6d31d6eb6a3650b075a8fa835e /drivers/staging/vt6655/key.c | |
parent | c7b09efacf54210be511450768c0ee98071feb7f (diff) |
staging: vt6655: Convert DBG_PRT to pr_<level>
DBG_PRT uses are unnecessarily complex.
Convert DBG_PRT msglevel to pr_<level>.
This changes the KERN_<level> type of several uses.
It also enables dynamic_debug for the pr_debug conversions.
This patch can be a prelude to converting these pr_<level>
uses to dev_<level> as appropriate.
Other changes:
Realign arguments of these conversions.
Remove now unused static int msglevel declarations.
Remove now unused DBG_PRT #define.
Compile tested only.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6655/key.c')
-rw-r--r-- | drivers/staging/vt6655/key.c | 122 |
1 files changed, 65 insertions, 57 deletions
diff --git a/drivers/staging/vt6655/key.c b/drivers/staging/vt6655/key.c index 19037908097d..211afae306c7 100644 --- a/drivers/staging/vt6655/key.c +++ b/drivers/staging/vt6655/key.c @@ -44,8 +44,6 @@ /*--------------------- Static Classes ----------------------------*/ -/*--------------------- Static Variables --------------------------*/ -static int msglevel = MSG_LEVEL_INFO; /*--------------------- Static Functions --------------------------*/ /*--------------------- Export Variables --------------------------*/ @@ -134,7 +132,7 @@ bool KeybGetKey( { int i; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetKey()\n"); + pr_debug("KeybGetKey()\n"); *pKey = NULL; for (i = 0; i < MAX_KEY_TABLE; i++) { @@ -196,7 +194,7 @@ bool KeybSetKey( PSKeyItem pKey; unsigned int uKeyIdx; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetKey: %lX\n", dwKeyIndex); + pr_debug("Enter KeybSetKey: %lX\n", dwKeyIndex); j = (MAX_KEY_TABLE-1); for (i = 0; i < (MAX_KEY_TABLE - 1); i++) { @@ -221,7 +219,8 @@ bool KeybSetKey( if ((dwKeyIndex & TRANSMIT_KEY) != 0) { // Group transmit key pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i); + pr_debug("Group transmit key(R)[%lX]: %d\n", + pTable->KeyTable[i].dwGTKeyIndex, i); } pTable->KeyTable[i].wKeyCtl &= 0xFF0F; // clear group key control filed pTable->KeyTable[i].wKeyCtl |= (byKeyDecMode << 4); @@ -252,17 +251,17 @@ bool KeybSetKey( pKey->dwTSC47_16 = 0; pKey->wTSC15_0 = 0; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybSetKey(R):\n"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: "); + pr_debug("KeybSetKey(R):\n"); + pr_debug("pKey->bKeyValid: %d\n ", pKey->bKeyValid); + pr_debug("pKey->abyKey: "); for (ii = 0; ii < pKey->uKeyLength; ii++) - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]); + pr_debug("%02x ", pKey->abyKey[ii]); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); + pr_debug("\n"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->wTSC15_0: %x\n ", pKey->wTSC15_0); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex); + pr_debug("pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16); + pr_debug("pKey->wTSC15_0: %x\n ", pKey->wTSC15_0); + pr_debug("pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex); return true; } @@ -284,7 +283,8 @@ bool KeybSetKey( if ((dwKeyIndex & TRANSMIT_KEY) != 0) { // Group transmit key pTable->KeyTable[j].dwGTKeyIndex = dwKeyIndex; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Group transmit key(N)[%lX]: %d\n", pTable->KeyTable[j].dwGTKeyIndex, j); + pr_debug("Group transmit key(N)[%lX]: %d\n", + pTable->KeyTable[j].dwGTKeyIndex, j); } pTable->KeyTable[j].wKeyCtl &= 0xFF0F; // clear group key control filed pTable->KeyTable[j].wKeyCtl |= (byKeyDecMode << 4); @@ -315,18 +315,18 @@ bool KeybSetKey( pKey->dwTSC47_16 = 0; pKey->wTSC15_0 = 0; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybSetKey(N):\n"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n ", (int)pKey->uKeyLength); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: "); + pr_debug("KeybSetKey(N):\n"); + pr_debug("pKey->bKeyValid: %d\n ", pKey->bKeyValid); + pr_debug("pKey->uKeyLength: %d\n ", (int)pKey->uKeyLength); + pr_debug("pKey->abyKey: "); for (ii = 0; ii < pKey->uKeyLength; ii++) - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]); + pr_debug("%02x ", pKey->abyKey[ii]); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); + pr_debug("\n"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->wTSC15_0: %x\n ", pKey->wTSC15_0); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex); + pr_debug("pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16); + pr_debug("pKey->wTSC15_0: %x\n ", pKey->wTSC15_0); + pr_debug("pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex); return true; } @@ -511,48 +511,51 @@ bool KeybGetTransmitKey( if (pTable->KeyTable[i].PairwiseKey.bKeyValid) { *pKey = &(pTable->KeyTable[i].PairwiseKey); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PAIRWISE_KEY: KeyTable.abyBSSID: "); + pr_debug("KeybGetTransmitKey:"); + pr_debug("PAIRWISE_KEY: KeyTable.abyBSSID: "); for (ii = 0; ii < 6; ii++) - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x ", pTable->KeyTable[i].abyBSSID[ii]); + pr_debug("%x ", + pTable->KeyTable[i].abyBSSID[ii]); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); + pr_debug("\n"); return true; } else { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PairwiseKey.bKeyValid == false\n"); + pr_debug("PairwiseKey.bKeyValid == false\n"); return false; } } // End of Type == PAIRWISE else { if (pTable->KeyTable[i].dwGTKeyIndex == 0) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ERROR: dwGTKeyIndex == 0 !!!\n"); + pr_debug("ERROR: dwGTKeyIndex == 0 !!!\n"); return false; } if (pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)].bKeyValid) { *pKey = &(pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)]); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GROUP_KEY: KeyTable.abyBSSID\n"); + pr_debug("KeybGetTransmitKey:"); + pr_debug("GROUP_KEY: KeyTable.abyBSSID\n"); for (ii = 0; ii < 6; ii++) - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x ", pTable->KeyTable[i].abyBSSID[ii]); + pr_debug("%x ", + pTable->KeyTable[i].abyBSSID[ii]); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dwGTKeyIndex: %lX\n", pTable->KeyTable[i].dwGTKeyIndex); + pr_debug("\n"); + pr_debug("dwGTKeyIndex: %lX\n", + pTable->KeyTable[i].dwGTKeyIndex); return true; } else { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GroupKey.bKeyValid == false\n"); + pr_debug("GroupKey.bKeyValid == false\n"); return false; } } // End of Type = GROUP } // BSSID match } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ERROR: NO Match BSSID !!! "); + pr_debug("ERROR: NO Match BSSID !!! "); for (ii = 0; ii < 6; ii++) - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", *(pbyBSSID+ii)); + pr_debug("%02x ", *(pbyBSSID+ii)); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); + pr_debug("\n"); return false; } @@ -617,7 +620,8 @@ bool KeybSetDefaultKey( PSKeyItem pKey; unsigned int uKeyIdx; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetDefaultKey: %1x, %d\n", (int)dwKeyIndex, (int)uKeyLength); + pr_debug("Enter KeybSetDefaultKey: %1x, %d\n", + (int)dwKeyIndex, (int)uKeyLength); if ((dwKeyIndex & PAIRWISE_KEY) != 0) // Pairwise key return false; @@ -636,7 +640,9 @@ bool KeybSetDefaultKey( if ((dwKeyIndex & TRANSMIT_KEY) != 0) { // Group transmit key pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex = dwKeyIndex; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex, MAX_KEY_TABLE-1); + pr_debug("Group transmit key(R)[%lX]: %d\n", + pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex, + MAX_KEY_TABLE-1); } pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl &= 0x7F00; // clear all key control filed @@ -676,18 +682,18 @@ bool KeybSetDefaultKey( pKey->dwTSC47_16 = 0; pKey->wTSC15_0 = 0; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybSetKey(R):\n"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n", pKey->bKeyValid); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n", (int)pKey->uKeyLength); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey:\n"); + pr_debug("KeybSetKey(R):\n"); + pr_debug("pKey->bKeyValid: %d\n", pKey->bKeyValid); + pr_debug("pKey->uKeyLength: %d\n", (int)pKey->uKeyLength); + pr_debug("pKey->abyKey:\n"); for (ii = 0; ii < pKey->uKeyLength; ii++) - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x", pKey->abyKey[ii]); + pr_debug("%x", pKey->abyKey[ii]); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); + pr_debug("\n"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n", pKey->dwTSC47_16); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->wTSC15_0: %x\n", pKey->wTSC15_0); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwKeyIndex: %lx\n", pKey->dwKeyIndex); + pr_debug("pKey->dwTSC47_16: %lx\n", pKey->dwTSC47_16); + pr_debug("pKey->wTSC15_0: %x\n", pKey->wTSC15_0); + pr_debug("pKey->dwKeyIndex: %lx\n", pKey->dwKeyIndex); return true; } @@ -724,7 +730,7 @@ bool KeybSetAllGroupKey( PSKeyItem pKey; unsigned int uKeyIdx; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetAllGroupKey: %lX\n", dwKeyIndex); + pr_debug("Enter KeybSetAllGroupKey: %lX\n", dwKeyIndex); if ((dwKeyIndex & PAIRWISE_KEY) != 0) // Pairwise key return false; @@ -739,7 +745,8 @@ bool KeybSetAllGroupKey( if ((dwKeyIndex & TRANSMIT_KEY) != 0) { // Group transmit key pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i); + pr_debug("Group transmit key(R)[%lX]: %d\n", + pTable->KeyTable[i].dwGTKeyIndex, i); } pTable->KeyTable[i].wKeyCtl &= 0xFF0F; // clear group key control filed @@ -771,14 +778,15 @@ bool KeybSetAllGroupKey( pKey->dwTSC47_16 = 0; pKey->wTSC15_0 = 0; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybSetKey(R):\n"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n ", (int)pKey->uKeyLength); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: "); + pr_debug("KeybSetKey(R):\n"); + pr_debug("pKey->bKeyValid: %d\n ", pKey->bKeyValid); + pr_debug("pKey->uKeyLength: %d\n ", + (int)pKey->uKeyLength); + pr_debug("pKey->abyKey: "); for (ii = 0; ii < pKey->uKeyLength; ii++) - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]); + pr_debug("%02x ", pKey->abyKey[ii]); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); + pr_debug("\n"); } // (pTable->KeyTable[i].bInUse == true) } |