lkml.org 
[lkml]   [2009]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH]crypto: Fix algorithm and driver duplicate registered
On Wed, Nov 25, 2009 at 05:35:16AM -0500, Youquan,Song wrote:
>
> For example:
>
> struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32
> mask)
>
> The parameter "name", sometime it is "alg->cra_name" while sometime it
> become "alg->cra_driver_name". What's to lookup, algorithm or driver, depends on
> the context of parameter, So it need confirm no duplicate name exists between
> cra_driver_name and cra_name. Therefore, there are some werid checking needed,
> such as following:
>
> if (!strcmp(q->cra_driver_name, alg->cra_name) ||
> !strcmp(q->cra_name, alg->cra_driver_name))
>
>
> I wonder, Can we define two functions: one lookup algorithm other lookup
> driver? It will be more clear.

No that would defeat the whole point of having algorithm names
vs. driver names. When you perform a lookup, we will look for
both algorithm matches AND driver matches. Exactly which one
takes precedence when two matches are present is determined by
the priority.

Anyway, none of this matters to you if you're just working with
driver implementations so don't even worry about this.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


\
 
 \ /
  Last update: 2009-11-25 04:15    [W:0.043 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site