From: "Youquan,Song" <youquan.song@linux.intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "Youquan,Song" <youquan.song@linux.intel.com>,
linux-kernel@vger.kernel.org, ying.huang@intel.com,
kent.liu@intel.com, youquan.song@intel.com
Subject: Re: [PATCH]crypto: Fix algorithm and driver duplicate registered
Date: Wed, 25 Nov 2009 05:35:16 -0500 [thread overview]
Message-ID: <20091125103516.GA25093@youquan-linux.bj.intel.com> (raw)
In-Reply-To: <20091123113126.GA6297@gondor.apana.org.au>
> On Mon, Nov 23, 2009 at 12:47:24PM -0500, Youquan,Song wrote:
> >
> > The alg->cra_name and alg->cra_driver_name, from the description,
> > cra_name is the algorithm name and cra_driver_name is the driver name.
>
> For each algorithm you may have an arbitrary number of drivers
> implementing it. The driver name must be unique. However,
> duplicates are allowed so that a new version of a driver may
> be loaded while the older instances of it are still in use.
>
> > But when I read the code, I often get confuse about these two names.
> > They often mix each other.
> >
> > Can you give me some instruction about them? or Can we make them more clear? Thanks.
>
> Well can you tell me what exactly confuses you?
Thanks.
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.
Thanks.
next prev parent reply other threads:[~2009-11-25 2:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-19 0:32 [PATCH]crypto: Fix algorithm and driver duplicate registered Youquan,Song
2009-11-19 0:18 ` Herbert Xu
2009-11-19 11:02 ` Youquan,Song
2009-11-19 11:47 ` Herbert Xu
2009-11-23 17:21 ` Youquan,Song
2009-11-23 10:52 ` Herbert Xu
2009-11-23 17:47 ` Youquan,Song
2009-11-23 11:31 ` Herbert Xu
2009-11-25 10:35 ` Youquan,Song [this message]
2009-11-25 3:12 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091125103516.GA25093@youquan-linux.bj.intel.com \
--to=youquan.song@linux.intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=kent.liu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ying.huang@intel.com \
--cc=youquan.song@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox