Re: [PATCH 2/3] staging: keucr: Use memcpy() instead custom StringCopy() and some style cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 02, 2011 at 10:01:35PM +0100, Javier Martinez Canillas wrote:
> 
> Signed-off-by: Javier Martinez Canillas <martinez.javier@xxxxxxxxx>
> ---
>  drivers/staging/keucr/smilecc.c |   16 ++++++++++------
>  1 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/keucr/smilecc.c b/drivers/staging/keucr/smilecc.c
> index daf322a..d915c04 100644
> --- a/drivers/staging/keucr/smilecc.c
> +++ b/drivers/staging/keucr/smilecc.c
> @@ -182,13 +182,17 @@ BYTE *buf;
>  BYTE *redundant_ecc;
>  BYTE *calculate_ecc;
>  {
> -    DWORD err;
> +	DWORD err;
>  
> -    err=correct_data(buf,redundant_ecc,*(calculate_ecc+1),*(calculate_ecc),*(calculate_ecc+2));
> -    if (err==1) StringCopy(calculate_ecc,redundant_ecc,3);
> -        if (err==0 || err==1 || err==2)
> -            return(0);
> -    return(-1);
> +	err = correct_data(buf, redundant_ecc, *(calculate_ecc + 1),
> +			   *(calculate_ecc), *(calculate_ecc + 2));
> +	if (err == 1)
> +		memcpy(calculate_ecc, redundant_ecc, 3);
> +
> +	if (err == 0 || err == 2)
> +		return 0;
> +
> +	return -1;
>  }

That's wrong. Before your change when correct_data returned 1 this function
returned 0. Now it returns -1.

Marcin

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux