From: Steffen Klassert <steffen.klassert@secunet.com>
To: Herbert Xu <herbert@gondor.hengli.com.au>
Cc: Dan Kruchinin <dkruchinin@acm.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/7] crypto: pcrypt - Rename pcrypt_instance
Date: Tue, 27 Jul 2010 07:16:33 +0200 [thread overview]
Message-ID: <20100727051633.GM11081@secunet.com> (raw)
In-Reply-To: <20100727051347.GI11081@secunet.com>
In the crypto-layer an instance refers usually to a crypto instance.
The struct pcrypt_instance is not related to a crypto instance.
It rather contains the padata informations, so we rename it to
padata_pcrypt. The functions that handle this struct are renamed
accordingly.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
crypto/pcrypt.c | 30 ++++++++++++++----------------
1 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index 5546083..7742553 100644
--- a/crypto/pcrypt.c
+++ b/crypto/pcrypt.c
@@ -28,8 +28,7 @@
#include <linux/kobject.h>
#include <crypto/pcrypt.h>
-struct pcrypt_instance {
- const char *name;
+struct padata_pcrypt {
struct padata_instance *pinst;
struct workqueue_struct *wq;
@@ -55,8 +54,8 @@ struct pcrypt_instance {
struct notifier_block nblock;
};
-static struct pcrypt_instance pencrypt;
-static struct pcrypt_instance pdecrypt;
+static struct padata_pcrypt pencrypt;
+static struct padata_pcrypt pdecrypt;
static struct kset *pcrypt_kset;
struct pcrypt_instance_ctx {
@@ -70,7 +69,7 @@ struct pcrypt_aead_ctx {
};
static int pcrypt_do_parallel(struct padata_priv *padata, unsigned int *cb_cpu,
- struct pcrypt_instance *pcrypt)
+ struct padata_pcrypt *pcrypt)
{
unsigned int cpu_index, cpu, i;
struct pcrypt_cpumask *cpumask;
@@ -408,13 +407,13 @@ static void pcrypt_free(struct crypto_instance *inst)
static int pcrypt_cpumask_change_notify(struct notifier_block *self,
unsigned long val, void *data)
{
- struct pcrypt_instance *pcrypt;
+ struct padata_pcrypt *pcrypt;
struct pcrypt_cpumask *new_mask, *old_mask;
if (!(val & PADATA_CPU_SERIAL))
return 0;
- pcrypt = container_of(self, struct pcrypt_instance, nblock);
+ pcrypt = container_of(self, struct padata_pcrypt, nblock);
new_mask = kmalloc(sizeof(*new_mask), GFP_KERNEL);
if (!new_mask)
return -ENOMEM;
@@ -446,13 +445,12 @@ static int pcrypt_sysfs_add(struct padata_instance *pinst, const char *name)
return ret;
}
-static int __pcrypt_init_instance(struct pcrypt_instance *pcrypt,
- const char *name)
+static int pcrypt_init_padata(struct padata_pcrypt *pcrypt,
+ const char *name)
{
int ret = -ENOMEM;
struct pcrypt_cpumask *mask;
- pcrypt->name = name;
pcrypt->wq = create_workqueue(name);
if (!pcrypt->wq)
goto err;
@@ -495,7 +493,7 @@ err:
return ret;
}
-static void __pcrypt_deinit_instance(struct pcrypt_instance *pcrypt)
+static void pcrypt_fini_padata(struct padata_pcrypt *pcrypt)
{
kobject_put(&pcrypt->pinst->kobj);
free_cpumask_var(pcrypt->cb_cpumask->mask);
@@ -522,11 +520,11 @@ static int __init pcrypt_init(void)
if (!pcrypt_kset)
goto err;
- err = __pcrypt_init_instance(&pencrypt, "pencrypt");
+ err = pcrypt_init_padata(&pencrypt, "pencrypt");
if (err)
goto err_unreg_kset;
- err = __pcrypt_init_instance(&pdecrypt, "pdecrypt");
+ err = pcrypt_init_padata(&pdecrypt, "pdecrypt");
if (err)
goto err_deinit_pencrypt;
@@ -536,7 +534,7 @@ static int __init pcrypt_init(void)
return crypto_register_template(&pcrypt_tmpl);
err_deinit_pencrypt:
- __pcrypt_deinit_instance(&pencrypt);
+ pcrypt_fini_padata(&pencrypt);
err_unreg_kset:
kset_unregister(pcrypt_kset);
err:
@@ -545,8 +543,8 @@ err:
static void __exit pcrypt_exit(void)
{
- __pcrypt_deinit_instance(&pencrypt);
- __pcrypt_deinit_instance(&pdecrypt);
+ pcrypt_fini_padata(&pencrypt);
+ pcrypt_fini_padata(&pdecrypt);
kset_unregister(pcrypt_kset);
crypto_unregister_template(&pcrypt_tmpl);
--
1.5.6.5
next prev parent reply other threads:[~2010-07-27 5:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-27 5:13 [PATCH 0/7] padata/pcrypt: cleanups Steffen Klassert
2010-07-27 5:14 ` [PATCH 1/7] padata: Rename padata_alloc functions Steffen Klassert
2010-07-27 5:15 ` [PATCH 2/7] padata: Rearrange set_cpumask functions Steffen Klassert
2010-07-27 5:15 ` [PATCH 3/7] padata: Pass the padata cpumasks to the cpumask_change_notifier chain Steffen Klassert
2010-07-27 5:16 ` Steffen Klassert [this message]
2010-07-27 5:18 ` [PATCH 5/7] crypto: pcrypt - Update pcrypt cpumask according to the padata cpumask notifier Steffen Klassert
2010-07-27 5:19 ` [PATCH 6/7] padata: Remove padata_get_cpumask Steffen Klassert
2010-07-27 5:20 ` [PATCH 7/7] padata: update API documentation Steffen Klassert
2010-08-03 17:53 ` Randy Dunlap
2010-07-31 11:56 ` [PATCH 0/7] padata/pcrypt: cleanups 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=20100727051633.GM11081@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=akpm@linux-foundation.org \
--cc=dkruchinin@acm.org \
--cc=herbert@gondor.hengli.com.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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