staging: keucr: Use memcpy() instead custom StringCopy() and some style cleanups
Subsystems (2)
PATCH 2/4 staging: keucr: Use memcpy() instead custom StringCopy() and some style cleanups
staging: keucr: Use memcpy() instead custom StringCopy() and some style cleanups
Signed-off-by Javier Martinez Canillas <[email protected]>
--- drivers/staging/keucr/smilecc.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-)
drivers/staging/keucr/smilecc.c +10 -6
@@ -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 =1 || err =2 ) +return 0 ; + +return -1 ; }void _Calculate_D_SwECC (buf ,ecc )
Signature · 1 line
1.7.0.4
Re: [PATCH 2/4] staging: keucr: Use memcpy() instead custom
Quoted 26 lines · Javier Martinez Canillas
staging: keucr: Use
memcpy()instead customStringCopy()and some style cleanupsSigned-off-by Javier Martinez Canillas <[email protected]>--- drivers/staging/keucr/smilecc.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-)drivers/staging/keucr/smilecc.c +3
-6@@ -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 ));
drivers/staging/keucr/smilecc.c BYTE *buf; · line 198
Quoted 10 lines
drivers/staging/keucr/smilecc.c +7
-0+if (err =1 ) +memcpy (calculate_ecc, redundant_ecc,3 ); + +if (err =0 || err =1 || err =2 ) +return 0 ; + +return -1 ; }void _Calculate_D_SwECC (buf ,ecc )
Now it looks good.
Reviewed-by Marcin Slusarz <[email protected]>