2017-08-25 18:24:11

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH] crypto: padlock-sha: constify x86_cpu_id

x86_cpu_id are not supposed to change at runtime. MODULE_DEVICE_TABLE
and x86_match_cpu are working with const x86_cpu_id. So mark the
non-const x86_cpu_id structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/crypto/padlock-sha.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/padlock-sha.c b/drivers/crypto/padlock-sha.c
index bc72d20..d32c793 100644
--- a/drivers/crypto/padlock-sha.c
+++ b/drivers/crypto/padlock-sha.c
@@ -509,7 +509,7 @@ static struct shash_alg sha256_alg_nano = {
}
};

-static struct x86_cpu_id padlock_sha_ids[] = {
+static const struct x86_cpu_id padlock_sha_ids[] = {
X86_FEATURE_MATCH(X86_FEATURE_PHE),
{}
};
--
2.7.4


2017-09-22 10:15:44

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: padlock-sha: constify x86_cpu_id

On Fri, Aug 25, 2017 at 11:53:59PM +0530, Arvind Yadav wrote:
> x86_cpu_id are not supposed to change at runtime. MODULE_DEVICE_TABLE
> and x86_match_cpu are working with const x86_cpu_id. So mark the
> non-const x86_cpu_id structs as const.
>
> Signed-off-by: Arvind Yadav <[email protected]>

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt