diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-19 19:43:19 -0400 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2017-11-06 15:49:44 -0500 |
commit | f34d8d506eeff1375f0b3533839ce0b77b748437 (patch) | |
tree | 82a36cdbcbe0362c1475af8864b42302fde53ab6 | |
parent | 439dc05fbfdbcf01995f4941ac597b8668e00ec3 (diff) |
crypto: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Lars Persson <lars.persson@axis.com>
Cc: Niklas Cassel <niklas.cassel@axis.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jamie Iles <jamie@jamieiles.com>
Cc: linux-arm-kernel@axis.com
Cc: linux-crypto@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: Lars Persson <lars.persson@axis.com> # for axis
-rw-r--r-- | drivers/crypto/axis/artpec6_crypto.c | 6 | ||||
-rw-r--r-- | drivers/crypto/mv_cesa.c | 4 | ||||
-rw-r--r-- | drivers/crypto/picoxcell_crypto.c | 7 |
3 files changed, 8 insertions, 9 deletions
diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c index d9fbbf01062b..6b515c2f2c14 100644 --- a/drivers/crypto/axis/artpec6_crypto.c +++ b/drivers/crypto/axis/artpec6_crypto.c | |||
@@ -2074,9 +2074,9 @@ static void artpec6_crypto_process_queue(struct artpec6_crypto *ac) | |||
2074 | del_timer(&ac->timer); | 2074 | del_timer(&ac->timer); |
2075 | } | 2075 | } |
2076 | 2076 | ||
2077 | static void artpec6_crypto_timeout(unsigned long data) | 2077 | static void artpec6_crypto_timeout(struct timer_list *t) |
2078 | { | 2078 | { |
2079 | struct artpec6_crypto *ac = (struct artpec6_crypto *) data; | 2079 | struct artpec6_crypto *ac = from_timer(ac, t, timer); |
2080 | 2080 | ||
2081 | dev_info_ratelimited(artpec6_crypto_dev, "timeout\n"); | 2081 | dev_info_ratelimited(artpec6_crypto_dev, "timeout\n"); |
2082 | 2082 | ||
@@ -3063,7 +3063,7 @@ static int artpec6_crypto_probe(struct platform_device *pdev) | |||
3063 | spin_lock_init(&ac->queue_lock); | 3063 | spin_lock_init(&ac->queue_lock); |
3064 | INIT_LIST_HEAD(&ac->queue); | 3064 | INIT_LIST_HEAD(&ac->queue); |
3065 | INIT_LIST_HEAD(&ac->pending); | 3065 | INIT_LIST_HEAD(&ac->pending); |
3066 | setup_timer(&ac->timer, artpec6_crypto_timeout, (unsigned long) ac); | 3066 | timer_setup(&ac->timer, artpec6_crypto_timeout, 0); |
3067 | 3067 | ||
3068 | ac->base = base; | 3068 | ac->base = base; |
3069 | 3069 | ||
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c index bf25f415eea6..0eb2706f23c8 100644 --- a/drivers/crypto/mv_cesa.c +++ b/drivers/crypto/mv_cesa.c | |||
@@ -149,7 +149,7 @@ struct mv_req_hash_ctx { | |||
149 | int count_add; | 149 | int count_add; |
150 | }; | 150 | }; |
151 | 151 | ||
152 | static void mv_completion_timer_callback(unsigned long unused) | 152 | static void mv_completion_timer_callback(struct timer_list *unused) |
153 | { | 153 | { |
154 | int active = readl(cpg->reg + SEC_ACCEL_CMD) & SEC_CMD_EN_SEC_ACCL0; | 154 | int active = readl(cpg->reg + SEC_ACCEL_CMD) & SEC_CMD_EN_SEC_ACCL0; |
155 | 155 | ||
@@ -167,7 +167,7 @@ static void mv_completion_timer_callback(unsigned long unused) | |||
167 | 167 | ||
168 | static void mv_setup_timer(void) | 168 | static void mv_setup_timer(void) |
169 | { | 169 | { |
170 | setup_timer(&cpg->completion_timer, &mv_completion_timer_callback, 0); | 170 | timer_setup(&cpg->completion_timer, mv_completion_timer_callback, 0); |
171 | mod_timer(&cpg->completion_timer, | 171 | mod_timer(&cpg->completion_timer, |
172 | jiffies + msecs_to_jiffies(MV_CESA_EXPIRE)); | 172 | jiffies + msecs_to_jiffies(MV_CESA_EXPIRE)); |
173 | } | 173 | } |
diff --git a/drivers/crypto/picoxcell_crypto.c b/drivers/crypto/picoxcell_crypto.c index b6f14844702e..5a6dc53b2b9d 100644 --- a/drivers/crypto/picoxcell_crypto.c +++ b/drivers/crypto/picoxcell_crypto.c | |||
@@ -1125,9 +1125,9 @@ static irqreturn_t spacc_spacc_irq(int irq, void *dev) | |||
1125 | return IRQ_HANDLED; | 1125 | return IRQ_HANDLED; |
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | static void spacc_packet_timeout(unsigned long data) | 1128 | static void spacc_packet_timeout(struct timer_list *t) |
1129 | { | 1129 | { |
1130 | struct spacc_engine *engine = (struct spacc_engine *)data; | 1130 | struct spacc_engine *engine = from_timer(engine, t, packet_timeout); |
1131 | 1131 | ||
1132 | spacc_process_done(engine); | 1132 | spacc_process_done(engine); |
1133 | } | 1133 | } |
@@ -1714,8 +1714,7 @@ static int spacc_probe(struct platform_device *pdev) | |||
1714 | writel(SPA_IRQ_EN_STAT_EN | SPA_IRQ_EN_GLBL_EN, | 1714 | writel(SPA_IRQ_EN_STAT_EN | SPA_IRQ_EN_GLBL_EN, |
1715 | engine->regs + SPA_IRQ_EN_REG_OFFSET); | 1715 | engine->regs + SPA_IRQ_EN_REG_OFFSET); |
1716 | 1716 | ||
1717 | setup_timer(&engine->packet_timeout, spacc_packet_timeout, | 1717 | timer_setup(&engine->packet_timeout, spacc_packet_timeout, 0); |
1718 | (unsigned long)engine); | ||
1719 | 1718 | ||
1720 | INIT_LIST_HEAD(&engine->pending); | 1719 | INIT_LIST_HEAD(&engine->pending); |
1721 | INIT_LIST_HEAD(&engine->completed); | 1720 | INIT_LIST_HEAD(&engine->completed); |