Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1391796 > unrolled thread

[PATCH] crypto: constify ccp_actions structure

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2016-05-01 14:10 +0200
Last post2016-05-03 10:20 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] crypto: constify ccp_actions structure Julia Lawall <Julia.Lawall@lip6.fr> - 2016-05-01 14:10 +0200
    Re: [PATCH] crypto: constify ccp_actions structure Gary R Hook <ghook@amd.com> - 2016-05-02 16:00 +0200
    Re: [PATCH] crypto: constify ccp_actions structure Herbert Xu <herbert@gondor.apana.org.au> - 2016-05-03 10:20 +0200

#1391796 — [PATCH] crypto: constify ccp_actions structure

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-05-01 14:10 +0200
Subject[PATCH] crypto: constify ccp_actions structure
Message-ID<rtYme-UR-17@gated-at.bofh.it>
The ccp_actions structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/crypto/ccp/ccp-dev-v3.c |    2 +-
 drivers/crypto/ccp/ccp-dev.h    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ccp/ccp-dev-v3.c b/drivers/crypto/ccp/ccp-dev-v3.c
index 597fc50..d7a7103 100644
--- a/drivers/crypto/ccp/ccp-dev-v3.c
+++ b/drivers/crypto/ccp/ccp-dev-v3.c
@@ -526,7 +526,7 @@ static irqreturn_t ccp_irq_handler(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static struct ccp_actions ccp3_actions = {
+static const struct ccp_actions ccp3_actions = {
 	.perform_aes = ccp_perform_aes,
 	.perform_xts_aes = ccp_perform_xts_aes,
 	.perform_sha = ccp_perform_sha,
diff --git a/drivers/crypto/ccp/ccp-dev.h b/drivers/crypto/ccp/ccp-dev.h
index 5d986c9..bd41ffce 100644
--- a/drivers/crypto/ccp/ccp-dev.h
+++ b/drivers/crypto/ccp/ccp-dev.h
@@ -162,7 +162,7 @@ struct ccp_actions {
 /* Structure to hold CCP version-specific values */
 struct ccp_vdata {
 	unsigned int version;
-	struct ccp_actions *perform;
+	const struct ccp_actions *perform;
 };
 
 extern struct ccp_vdata ccpv3;

[toc] | [next] | [standalone]


#1392224

FromGary R Hook <ghook@amd.com>
Date2016-05-02 16:00 +0200
Message-ID<rumye-4g2-21@gated-at.bofh.it>
In reply to#1391796
On 05/01/2016 06:52 AM, Julia Lawall wrote:
> The ccp_actions structure is never modified, so declare it as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Gary Hook <gary.hook@amd.com>

> ---
>   drivers/crypto/ccp/ccp-dev-v3.c |    2 +-
>   drivers/crypto/ccp/ccp-dev.h    |    2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/ccp/ccp-dev-v3.c b/drivers/crypto/ccp/ccp-dev-v3.c
> index 597fc50..d7a7103 100644
> --- a/drivers/crypto/ccp/ccp-dev-v3.c
> +++ b/drivers/crypto/ccp/ccp-dev-v3.c
> @@ -526,7 +526,7 @@ static irqreturn_t ccp_irq_handler(int irq, void *data)
>   	return IRQ_HANDLED;
>   }
>   
> -static struct ccp_actions ccp3_actions = {
> +static const struct ccp_actions ccp3_actions = {
>   	.perform_aes = ccp_perform_aes,
>   	.perform_xts_aes = ccp_perform_xts_aes,
>   	.perform_sha = ccp_perform_sha,
> diff --git a/drivers/crypto/ccp/ccp-dev.h b/drivers/crypto/ccp/ccp-dev.h
> index 5d986c9..bd41ffce 100644
> --- a/drivers/crypto/ccp/ccp-dev.h
> +++ b/drivers/crypto/ccp/ccp-dev.h
> @@ -162,7 +162,7 @@ struct ccp_actions {
>   /* Structure to hold CCP version-specific values */
>   struct ccp_vdata {
>   	unsigned int version;
> -	struct ccp_actions *perform;
> +	const struct ccp_actions *perform;
>   };
>   
>   extern struct ccp_vdata ccpv3;
>

[toc] | [prev] | [next] | [standalone]


#1393161

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2016-05-03 10:20 +0200
Message-ID<ruDIL-4pf-25@gated-at.bofh.it>
In reply to#1391796
On Sun, May 01, 2016 at 01:52:55PM +0200, Julia Lawall wrote:
> The ccp_actions structure is never modified, so declare it as const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web