* [PATCH 1/4] staging: vt6656: channel.c: Remove dead code
@ 2011-12-01 0:22 Marcos Paulo de Souza
2011-12-01 15:00 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Marcos Paulo de Souza @ 2011-12-01 0:22 UTC (permalink / raw)
To: linux-kernel
Cc: Marcos Paulo de Souza, Greg Kroah-Hartman, Forest Bond, devel
This patch remove some unneeded code. Some comments, for loop doing
nothing, debug messages and unneeded variables was removed.
Signed-off-by: Marcos Paulo de Souza <marcos.mage@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Forest Bond <forest@alittletooquiet.net>
Cc: devel@driverdev.osuosl.org
---
drivers/staging/vt6656/channel.c | 81 ++++++++------------------------------
1 files changed, 17 insertions(+), 64 deletions(-)
diff --git a/drivers/staging/vt6656/channel.c b/drivers/staging/vt6656/channel.c
index 99e054d..172e017 100644
--- a/drivers/staging/vt6656/channel.c
+++ b/drivers/staging/vt6656/channel.c
@@ -39,15 +39,6 @@
#include "channel.h"
#include "rf.h"
-/*--------------------- Static Definitions -------------------------*/
-static int msglevel = MSG_LEVEL_INFO;
-//static int msglevel =MSG_LEVEL_DEBUG;
-
-/*--------------------- Static Classes ----------------------------*/
-
-/*--------------------- Export Definitions -------------------------*/
-
-
static SChannelTblElement sChannelTbl[CB_MAX_CHANNEL+1] =
{
{0, 0, FALSE},
@@ -392,25 +383,15 @@ static struct
BOOL
ChannelValid(unsigned int CountryCode, unsigned int ChannelIndex)
{
- BOOL bValid;
-
- bValid = FALSE;
- /*
- * If Channel Index is invalid, return invalid
- */
- if ((ChannelIndex > CB_MAX_CHANNEL) ||
- (ChannelIndex == 0))
- {
- bValid = FALSE;
- goto exit;
- }
-
- bValid = sChannelTbl[ChannelIndex].bValid;
-
-exit:
- return (bValid);
+ /*
+ * If Channel Index is invalid, return invalid
+ */
+ if ((ChannelIndex > CB_MAX_CHANNEL) ||
+ (ChannelIndex == 0))
+ return FALSE;
-} /* end ChannelValid */
+ return sChannelTbl[ChannelIndex].bValid;
+}
/************************************************************************
* CHvChannelGetList
@@ -463,51 +444,23 @@ void CHvInitChannelTable(void *pDeviceHandler)
if ((pDevice->dwDiagRefCount != 0) ||
(pDevice->b11hEable == TRUE)) {
- if (bMultiBand == TRUE) {
- for (ii = 0; ii < CB_MAX_CHANNEL; ii++) {
+ if (bMultiBand == TRUE)
+ for (ii = 0; ii < CB_MAX_CHANNEL; ii++)
sChannelTbl[ii+1].bValid = TRUE;
- //pDevice->abyRegPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1];
- //pDevice->abyLocalPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1];
- }
- for (ii = 0; ii < CB_MAX_CHANNEL_24G; ii++) {
- //pDevice->abyRegPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1];
- //pDevice->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1];
- }
- } else {
- for (ii = 0; ii < CB_MAX_CHANNEL_24G; ii++) {
+ else
+ for (ii = 0; ii < CB_MAX_CHANNEL_24G; ii++)
sChannelTbl[ii+1].bValid = TRUE;
- //pDevice->abyRegPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1];
- //pDevice->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1];
- }
- }
+
} else if (pDevice->byZoneType <= CCODE_MAX) {
if (bMultiBand == TRUE) {
- for (ii = 0; ii < CB_MAX_CHANNEL; ii++) {
- if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) {
+ for (ii = 0; ii < CB_MAX_CHANNEL; ii++)
+ if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0)
sChannelTbl[ii+1].bValid = TRUE;
- //pDevice->abyRegPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii];
- //pDevice->abyLocalPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii];
- }
- }
} else {
- for (ii = 0; ii < CB_MAX_CHANNEL_24G; ii++) {
- if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) {
+ for (ii = 0; ii < CB_MAX_CHANNEL_24G; ii++)
+ if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0)
sChannelTbl[ii+1].bValid = TRUE;
- //pDevice->abyRegPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii];
- //pDevice->abyLocalPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii];
- }
- }
- }
- }
- DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO"Zone=[%d][%c][%c]!!\n",pDevice->byZoneType,ChannelRuleTab[pDevice->byZoneType].chCountryCode[0],ChannelRuleTab[pDevice->byZoneType].chCountryCode[1]);
- for (ii = 0; ii < CB_MAX_CHANNEL; ii++) {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Channel[%d] is [%d]\n",sChannelTbl[ii].byChannelNumber,sChannelTbl[ii+1].bValid);
- /*if (pDevice->abyRegPwr[ii+1] == 0) {
- pDevice->abyRegPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1];
}
- if (pDevice->abyLocalPwr[ii+1] == 0) {
- pDevice->abyLocalPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1];
- }*/
}
}
--
1.7.4.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/4] staging: vt6656: channel.c: Remove dead code
2011-12-01 0:22 [PATCH 1/4] staging: vt6656: channel.c: Remove dead code Marcos Paulo de Souza
@ 2011-12-01 15:00 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2011-12-01 15:00 UTC (permalink / raw)
To: Marcos Paulo de Souza
Cc: linux-kernel, devel, Greg Kroah-Hartman, Forest Bond
[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]
On Thu, Dec 01, 2011 at 12:22:49AM +0000, Marcos Paulo de Souza wrote:
> This patch remove some unneeded code. Some comments, for loop doing
> nothing, debug messages and unneeded variables was removed.
>
This rewrites some stuff, it's not just deleting stuff... Yes,
you've rewritten it in a better way, but you should mention that in
the changelog. Maybe break it up into smaller patches or something?
> @@ -463,51 +444,23 @@ void CHvInitChannelTable(void *pDeviceHandler)
>
> if ((pDevice->dwDiagRefCount != 0) ||
> (pDevice->b11hEable == TRUE)) {
> - if (bMultiBand == TRUE) {
> - for (ii = 0; ii < CB_MAX_CHANNEL; ii++) {
> + if (bMultiBand == TRUE)
^
Don't delete the '{' from here. Multi-line indents get {} braces
even though it's not needed for semantic reasons.
I told you that yesterday. :/
> + for (ii = 0; ii < CB_MAX_CHANNEL; ii++)
> sChannelTbl[ii+1].bValid = TRUE;
regards,
dan carpenter
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-01 14:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01 0:22 [PATCH 1/4] staging: vt6656: channel.c: Remove dead code Marcos Paulo de Souza
2011-12-01 15:00 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox