提交 e4bc02ac 编写于 作者: J Julia Lawall 提交者: Herbert Xu

crypto: drbg - constify drbg_state_ops structures

The drbg_state_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.
Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 161151d7
...@@ -626,7 +626,7 @@ static int drbg_ctr_generate(struct drbg_state *drbg, ...@@ -626,7 +626,7 @@ static int drbg_ctr_generate(struct drbg_state *drbg,
return len; return len;
} }
static struct drbg_state_ops drbg_ctr_ops = { static const struct drbg_state_ops drbg_ctr_ops = {
.update = drbg_ctr_update, .update = drbg_ctr_update,
.generate = drbg_ctr_generate, .generate = drbg_ctr_generate,
.crypto_init = drbg_init_sym_kernel, .crypto_init = drbg_init_sym_kernel,
...@@ -752,7 +752,7 @@ static int drbg_hmac_generate(struct drbg_state *drbg, ...@@ -752,7 +752,7 @@ static int drbg_hmac_generate(struct drbg_state *drbg,
return len; return len;
} }
static struct drbg_state_ops drbg_hmac_ops = { static const struct drbg_state_ops drbg_hmac_ops = {
.update = drbg_hmac_update, .update = drbg_hmac_update,
.generate = drbg_hmac_generate, .generate = drbg_hmac_generate,
.crypto_init = drbg_init_hash_kernel, .crypto_init = drbg_init_hash_kernel,
...@@ -1032,7 +1032,7 @@ static int drbg_hash_generate(struct drbg_state *drbg, ...@@ -1032,7 +1032,7 @@ static int drbg_hash_generate(struct drbg_state *drbg,
* scratchpad usage: as update and generate are used isolated, both * scratchpad usage: as update and generate are used isolated, both
* can use the scratchpad * can use the scratchpad
*/ */
static struct drbg_state_ops drbg_hash_ops = { static const struct drbg_state_ops drbg_hash_ops = {
.update = drbg_hash_update, .update = drbg_hash_update,
.generate = drbg_hash_generate, .generate = drbg_hash_generate,
.crypto_init = drbg_init_hash_kernel, .crypto_init = drbg_init_hash_kernel,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册