staging: vt6655: add missing curly braces
Subsystems (2)
PATCH 1/1 staging: vt6655: add missing curly braces
It's clear from the indent levels and the context that there are supposed to be curly braces here.
drivers/staging/vt6655/card.c +4 -2
@@ -2788,16 +2788,18 @@ void CARDvUpdateBasicTopRate (PVOID pDeviceHandler)//Determines the highest basic rate. for (ii =RATE_54M ; ii >=RATE_6M ; ii --) { -if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) +if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) { byTopOFDM = ii;break ; + } } pDevice->byTopOFDMBasicRate = byTopOFDM;for (ii =RATE_11M ;; ii --) { -if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) +if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) { byTopCCK = ii;break ; + }if (ii =RATE_1M )break ; }
Quoted 20 lines · Dan Carpenter
It's clear from the indent levels and the context that there are supposed to be curly braces here.
Signed-off-by Dan Carpenter <[email protected]>drivers/staging/vt6655/card.c +2
-1@@ -2788,16 +2788,18 @@ void CARDvUpdateBasicTopRate (PVOID pDeviceHandler)//Determines the highest basic rate. for (ii =RATE_54M ; ii >=RATE_6M ; ii --) { -if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) +if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) { byTopOFDM = ii;break ; + } } pDevice->byTopOFDMBasicRate = byTopOFDM;
drivers/staging/vt6655/card.c void CARDvUpdateBasicTopRate (PVOID pDeviceHandler) · line 2805
Quoted 10 lines
drivers/staging/vt6655/card.c +2
-1for (ii =RATE_11M ;; ii --) { -if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) +if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) { byTopCCK = ii;break ; + }if (ii =RATE_1M )break ; }
this is a realy nice catch :)
NTL i guess the code is looking for the highest bit that could be replace with kernel code. (ffs() ?)
just my 2 cents,
wh
Quoted 24 lines · walter harms
Quoted 21 lines · Dan Carpenter
It's clear from the indent levels and the context that there are supposed to be curly braces here.
Signed-off-by Dan Carpenter <[email protected]>drivers/staging/vt6655/card.c +2
-1@@ -2788,16 +2788,18 @@ void CARDvUpdateBasicTopRate (PVOID pDeviceHandler)//Determines the highest basic rate. for (ii =RATE_54M ; ii >=RATE_6M ; ii --) { -if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) +if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) { byTopOFDM = ii;break ; + } } pDevice->byTopOFDMBasicRate = byTopOFDM;
Quoted 12 lines
drivers/staging/vt6655/card.c void CARDvUpdateBasicTopRate (PVOID pDeviceHandler) · line 2805
Quoted 9 lines
drivers/staging/vt6655/card.c +2
-1for (ii =RATE_11M ;; ii --) { -if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) +if ( (pDevice->wBasicRate) & ((WORD )(1 <<ii)) ) { byTopCCK = ii;break ; + }if (ii =RATE_1M )break ; }this is a realy nice catch :)
It was just a smatch thing.
Quoted 3 lines
NTL i guess the code is looking for the highest bit that could be replace with kernel code. (
ffs()?)
Well, it's not exactly ffs() because ffs(1) would return 1 but the in this code when pDevice->wBasicRate is 1 byTopCCK would be 0.
if ( (pDevice->wBasicRate) & ((WORD)(1 << ii)) ) {
if ( 1 & (1 << 1)) { is false.
if ( 1 & (1 << 0)) { is true.But sure, I can send a patch in the next email.
regards,
dan carpenter
Quoted 2 lines
just my 2 cents,
wh