OSDN Git Service

[PATCH] flashpoint: use '!' instead of '~' with EE_SYNC_MASK
authorWilly Tarreau <w@1wt.eu>
Thu, 23 Nov 2006 21:21:08 +0000 (22:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 23 Nov 2006 21:21:08 +0000 (22:21 +0100)
Trivial typo found by grep in 2.4 code, already fixed in 2.6.
The complement mask was computed with '!' instead of '~' while
the mask was not 1 :

  #define  EE_SYNC_MASK      (BIT(0)+BIT(1))
  currTar_Info->TarEEValue = (currTar_Info->TarEEValue & !EE_SYNC_MASK)
  temp2.tempb[0] = (temp2.tempb[0] & !EE_SYNC_MASK) | syncVal;
  temp2.tempb[1] = (temp2.tempb[1] & !EE_SYNC_MASK) | syncVal;

drivers/scsi/FlashPoint.c

index 9b07421..af5d980 100644 (file)
@@ -3757,17 +3757,17 @@ STATIC int SetDevSyncRate(PSCCBcard pCurrCard, PUCB p_ucb)
        }
        if(currTar_Info->TarEEValue && EE_SYNC_MASK == syncVal)
                return(0);
-       currTar_Info->TarEEValue = (currTar_Info->TarEEValue & !EE_SYNC_MASK)
+       currTar_Info->TarEEValue = (currTar_Info->TarEEValue & ~EE_SYNC_MASK)
                                                                                        | syncVal;
        syncOffset = (SYNC_RATE_TBL + scsiID) / 2;
        temp2.tempw = utilEERead(ioPort, syncOffset);
        if(scsiID & 0x01)
        {
-               temp2.tempb[0] = (temp2.tempb[0] & !EE_SYNC_MASK) | syncVal;
+               temp2.tempb[0] = (temp2.tempb[0] & ~EE_SYNC_MASK) | syncVal;
        }
        else
        {
-               temp2.tempb[1] = (temp2.tempb[1] & !EE_SYNC_MASK) | syncVal;
+               temp2.tempb[1] = (temp2.tempb[1] & ~EE_SYNC_MASK) | syncVal;
        }
        utilEEWriteOnOff(ioPort, 1);
        utilEEWrite(ioPort, temp2.tempw, syncOffset);