* [PATCH 2/3] staging: keucr: Use memcpy() instead custom StringCopy() and some style cleanups
@ 2011-01-02 21:01 Javier Martinez Canillas
2011-01-02 21:49 ` [PATCH 2/3] staging: keucr: Use memcpy() instead custom Marcin Slusarz
2011-01-02 21:57 ` Javier Martinez Canillas
0 siblings, 2 replies; 3+ messages in thread
From: Javier Martinez Canillas @ 2011-01-02 21:01 UTC (permalink / raw)
To: kernel-janitors
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
---
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;
}
void _Calculate_D_SwECC(buf,ecc)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] staging: keucr: Use memcpy() instead custom
2011-01-02 21:01 [PATCH 2/3] staging: keucr: Use memcpy() instead custom StringCopy() and some style cleanups Javier Martinez Canillas
@ 2011-01-02 21:49 ` Marcin Slusarz
2011-01-02 21:57 ` Javier Martinez Canillas
1 sibling, 0 replies; 3+ messages in thread
From: Marcin Slusarz @ 2011-01-02 21:49 UTC (permalink / raw)
To: kernel-janitors
On Sun, Jan 02, 2011 at 10:01:35PM +0100, Javier Martinez Canillas wrote:
>
> Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] staging: keucr: Use memcpy() instead custom
2011-01-02 21:01 [PATCH 2/3] staging: keucr: Use memcpy() instead custom StringCopy() and some style cleanups Javier Martinez Canillas
2011-01-02 21:49 ` [PATCH 2/3] staging: keucr: Use memcpy() instead custom Marcin Slusarz
@ 2011-01-02 21:57 ` Javier Martinez Canillas
1 sibling, 0 replies; 3+ messages in thread
From: Javier Martinez Canillas @ 2011-01-02 21:57 UTC (permalink / raw)
To: kernel-janitors
>> + 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
>
>
Yes, I'm preparing a new patchset that also corrects that. Thanks
--
Best regards,
-----------------------------------------
Javier Martínez Canillas
(+34) 682 39 81 69
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-02 21:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-02 21:01 [PATCH 2/3] staging: keucr: Use memcpy() instead custom StringCopy() and some style cleanups Javier Martinez Canillas
2011-01-02 21:49 ` [PATCH 2/3] staging: keucr: Use memcpy() instead custom Marcin Slusarz
2011-01-02 21:57 ` Javier Martinez Canillas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox