[PATCH 02/19] crypto: atmel: convert tasklets to use new tasklet_setup() API

From: Allen Pais
Date: Mon Aug 17 2020 - 04:10:18 EST


In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@xxxxxxxxx>
Signed-off-by: Allen Pais <allen.lkml@xxxxxxxxx>
---
drivers/crypto/atmel-aes.c | 14 ++++++--------
drivers/crypto/atmel-sha.c | 14 ++++++--------
drivers/crypto/atmel-tdes.c | 14 ++++++--------
3 files changed, 18 insertions(+), 24 deletions(-)

diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index a6e14491e080..99851e40c729 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -2300,16 +2300,16 @@ static void atmel_aes_dma_cleanup(struct atmel_aes_dev *dd)
dma_release_channel(dd->src.chan);
}

-static void atmel_aes_queue_task(unsigned long data)
+static void atmel_aes_queue_task(struct tasklet_struct *t)
{
- struct atmel_aes_dev *dd = (struct atmel_aes_dev *)data;
+ struct atmel_aes_dev *dd = from_tasklet(dd, t, queue_task);

atmel_aes_handle_queue(dd, NULL);
}

-static void atmel_aes_done_task(unsigned long data)
+static void atmel_aes_done_task(struct tasklet_struct *t)
{
- struct atmel_aes_dev *dd = (struct atmel_aes_dev *)data;
+ struct atmel_aes_dev *dd = from_tasklet(dd, t, done_task);

dd->is_async = true;
(void)dd->resume(dd);
@@ -2499,10 +2499,8 @@ static int atmel_aes_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&aes_dd->list);
spin_lock_init(&aes_dd->lock);

- tasklet_init(&aes_dd->done_task, atmel_aes_done_task,
- (unsigned long)aes_dd);
- tasklet_init(&aes_dd->queue_task, atmel_aes_queue_task,
- (unsigned long)aes_dd);
+ tasklet_setup(&aes_dd->done_task, atmel_aes_done_task);
+ tasklet_setup(&aes_dd->queue_task, atmel_aes_queue_task);

crypto_init_queue(&aes_dd->queue, ATMEL_AES_QUEUE_LENGTH);

diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 75ccf41a7cb9..84a7c8a9dd02 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -1314,9 +1314,9 @@ static struct ahash_alg sha_384_512_algs[] = {
},
};

-static void atmel_sha_queue_task(unsigned long data)
+static void atmel_sha_queue_task(struct tasklet_struct *t)
{
- struct atmel_sha_dev *dd = (struct atmel_sha_dev *)data;
+ struct atmel_sha_dev *dd = from_tasklet(dd, t, queue_task);

atmel_sha_handle_queue(dd, NULL);
}
@@ -1353,9 +1353,9 @@ static int atmel_sha_done(struct atmel_sha_dev *dd)
return err;
}

-static void atmel_sha_done_task(unsigned long data)
+static void atmel_sha_done_task(struct tasklet_struct *t)
{
- struct atmel_sha_dev *dd = (struct atmel_sha_dev *)data;
+ struct atmel_sha_dev *dd = from_tasklet(dd, t, done_task);

dd->is_async = true;
(void)dd->resume(dd);
@@ -2570,10 +2570,8 @@ static int atmel_sha_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&sha_dd->list);
spin_lock_init(&sha_dd->lock);

- tasklet_init(&sha_dd->done_task, atmel_sha_done_task,
- (unsigned long)sha_dd);
- tasklet_init(&sha_dd->queue_task, atmel_sha_queue_task,
- (unsigned long)sha_dd);
+ tasklet_setup(&sha_dd->done_task, atmel_sha_done_task);
+ tasklet_setup(&sha_dd->queue_task, atmel_sha_queue_task);

crypto_init_queue(&sha_dd->queue, ATMEL_SHA_QUEUE_LENGTH);

diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c
index ed40dbb98c6b..170809892acf 100644
--- a/drivers/crypto/atmel-tdes.c
+++ b/drivers/crypto/atmel-tdes.c
@@ -1049,16 +1049,16 @@ static struct skcipher_alg tdes_algs[] = {
},
};

-static void atmel_tdes_queue_task(unsigned long data)
+static void atmel_tdes_queue_task(struct tasklet_struct *t)
{
- struct atmel_tdes_dev *dd = (struct atmel_tdes_dev *)data;
+ struct atmel_tdes_dev *dd = from_tasklet(dd, t, queue_task);

atmel_tdes_handle_queue(dd, NULL);
}

-static void atmel_tdes_done_task(unsigned long data)
+static void atmel_tdes_done_task(struct tasklet_struct *t)
{
- struct atmel_tdes_dev *dd = (struct atmel_tdes_dev *) data;
+ struct atmel_tdes_dev *dd = from_tasklet(dd, t, done_task);
int err;

if (!(dd->flags & TDES_FLAGS_DMA))
@@ -1177,10 +1177,8 @@ static int atmel_tdes_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&tdes_dd->list);
spin_lock_init(&tdes_dd->lock);

- tasklet_init(&tdes_dd->done_task, atmel_tdes_done_task,
- (unsigned long)tdes_dd);
- tasklet_init(&tdes_dd->queue_task, atmel_tdes_queue_task,
- (unsigned long)tdes_dd);
+ tasklet_setup(&tdes_dd->done_task, atmel_tdes_done_task);
+ tasklet_setup(&tdes_dd->queue_task, atmel_tdes_queue_task);

crypto_init_queue(&tdes_dd->queue, ATMEL_TDES_QUEUE_LENGTH);

--
2.17.1