[PATCH 1/3] staging: keucr: Use memcmp() instead custom StringCmp() and some style cleanups

Javier Martinez Canillas martinez.javier at gmail.com
Sun Jan 2 21:21:36 UTC 2011


>>  int Check_D_ReadError(BYTE *redundant)
>>  {
>> -    // Driver 䣰 ECC Check
>> -    return(SUCCESS);
>> -    if (!StringCmp((char *)(redundant+0x0D),(char *)EccBuf,3))
>> -        if (!StringCmp((char *)(redundant+0x08),(char *)(EccBuf+0x03),3))
>> -            return(SUCCESS);
>> +     /* Driver ECC Check */
>> +     if (memcmp(redundant + 0x0D, EccBuf, 3) ||
>> +         memcmp(redundant + 0x08, EccBuf + 0x03, 3))
>> +             return ERROR;
>>
>> -    return(ERROR);
>> +     return SUCCESS;
>>  }
>
> This code isn't the same.
>
> Before, the return was always SUCCESS and the code
> after the first return was ignored.
>
> You deleted that return and now you do the driver ECC check.
> Is that correct?
>

You are right Joe, sorry for that. Should I remove the dead code after
the return SUCCESS or keep it?

-- 
Best regards,

-----------------------------------------
Javier Martínez Canillas
(+34) 682 39 81 69



More information about the devel mailing list