* [PATCH 3/5] crypto/nx: Create nx842_delete_coproc function
@ 2017-04-01 17:00 Haren Myneni
2017-04-04 11:13 ` Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: Haren Myneni @ 2017-04-01 17:00 UTC (permalink / raw)
To: herbert, mpe, ddstreet
Cc: linuxppc-dev, linux-crypto, benh, mikey, suka, hbabu
[PATCH 3/5] crypto/nx: Create nx842_delete_coproc function
Move deleting coprocessor info upon exit or failure to
nx842_delete_coproc().
Signed-off-by: Haren Myneni <haren@us.ibm.com>
---
drivers/crypto/nx/nx-842-powernv.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c
index 4cd6a6f..8737e90 100644
--- a/drivers/crypto/nx/nx-842-powernv.c
+++ b/drivers/crypto/nx/nx-842-powernv.c
@@ -597,6 +597,16 @@ static int __init nx842_powernv_probe(struct device_node *dn)
return 0;
}
+static void nx842_delete_coproc(void)
+{
+ struct nx842_coproc *coproc, *n;
+
+ list_for_each_entry_safe(coproc, n, &nx842_coprocs, list) {
+ list_del(&coproc->list);
+ kfree(coproc);
+ }
+}
+
static struct nx842_constraints nx842_powernv_constraints = {
.alignment = DDE_BUFFER_ALIGN,
.multiple = DDE_BUFFER_LAST_MULT,
@@ -656,13 +666,7 @@ static __init int nx842_powernv_init(void)
ret = crypto_register_alg(&nx842_powernv_alg);
if (ret) {
- struct nx842_coproc *coproc, *n;
-
- list_for_each_entry_safe(coproc, n, &nx842_coprocs, list) {
- list_del(&coproc->list);
- kfree(coproc);
- }
-
+ nx842_delete_coproc();
return ret;
}
@@ -672,13 +676,8 @@ static __init int nx842_powernv_init(void)
static void __exit nx842_powernv_exit(void)
{
- struct nx842_coproc *coproc, *n;
-
crypto_unregister_alg(&nx842_powernv_alg);
- list_for_each_entry_safe(coproc, n, &nx842_coprocs, list) {
- list_del(&coproc->list);
- kfree(coproc);
- }
+ nx842_delete_coproc();
}
module_exit(nx842_powernv_exit);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 3/5] crypto/nx: Create nx842_delete_coproc function
2017-04-01 17:00 [PATCH 3/5] crypto/nx: Create nx842_delete_coproc function Haren Myneni
@ 2017-04-04 11:13 ` Michael Ellerman
0 siblings, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2017-04-04 11:13 UTC (permalink / raw)
To: Haren Myneni, herbert, ddstreet; +Cc: mikey, suka, linux-crypto, linuxppc-dev
Haren Myneni <haren@linux.vnet.ibm.com> writes:
> [PATCH 3/5] crypto/nx: Create nx842_delete_coproc function
>
> Move deleting coprocessor info upon exit or failure to
> nx842_delete_coproc().
Naming again, this deletes *all* the coprocs, so the name should be
plural.
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/5] crypto/nx: Create nx842_delete_coproc function
@ 2017-04-04 11:13 ` Michael Ellerman
0 siblings, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2017-04-04 11:13 UTC (permalink / raw)
To: Haren Myneni, herbert, ddstreet
Cc: linuxppc-dev, linux-crypto, benh, mikey, suka, hbabu
Haren Myneni <haren@linux.vnet.ibm.com> writes:
> [PATCH 3/5] crypto/nx: Create nx842_delete_coproc function
>
> Move deleting coprocessor info upon exit or failure to
> nx842_delete_coproc().
Naming again, this deletes *all* the coprocs, so the name should be
plural.
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-04 11:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-01 17:00 [PATCH 3/5] crypto/nx: Create nx842_delete_coproc function Haren Myneni
2017-04-04 11:13 ` Michael Ellerman
2017-04-04 11:13 ` Michael Ellerman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.