Skip to contentSkip to conversation

staging: vt6655: add missing curly braces

PATCH In review Dan Carpenter 2 participants 3 messages Feb 12, 2010 – Feb 13, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index db78614..bf4fd49 100644
@@ -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;
      }
#1 lore raw
Quoted 20 lines · Dan Carpenter

It's clear from the indent levels and the context that there are supposed to be curly braces here.

drivers/staging/vt6655/card.c +2 -1
index db78614..bf4fd49 100644
@@ -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 -1
 
      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;
      }

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

#2 lore raw
In reply to Dan Carpenter
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.

drivers/staging/vt6655/card.c +2 -1
index db78614..bf4fd49 100644
@@ -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 -1
      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;
      }

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