lkml.org 
[lkml]   [2011]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/3] trusted-keys: small cleanup
From
Date
On Tue, 2011-01-18 at 20:03 +0900, Tetsuo Handa wrote:
> Mimi Zohar wrote:
> > > > va_end(argp);
> > > > - ret = crypto_shash_final(&sdesc->shash, paramdigest);
> > > > + if (!ret)
> > > > + ret = crypto_shash_final(&sdesc->shash, paramdigest);
> > > > if (!ret)
> >
> > Change the second '(!ret)' here, the crypto_shash_file() return code
> > test, from '(!ret)' to '(ret < 0)', like the other crypto_shash_file()
> > tests.
>
> Did you mean changing from
>
> if (!ret)
> ret = crypto_shash_final(&sdesc->shash, paramdigest);
>
> to
>
> if (ret < 0)
> ret = crypto_shash_final(&sdesc->shash, paramdigest);
>
> (i.e. invert the condition)?

Wrong '(!ret)'. Instead of:
va_end(argp);
if (!ret)
ret = crypto_shash_final(&sdesc->shash, paramdigest);
if (!ret)

do:
va_end(argp);
if (!ret)
ret = crypto_shash_final(&sdesc->shash, paramdigest);
if (ret < 0)

> I'm confused. Would you make the patch by yourself?

It's only for consistency, not that important.

thanks,

Mimi




\
 
 \ /
  Last update: 2011-01-18 12:31    [W:0.075 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site