From: Rikard Falkeborn Date: Sat, 21 Nov 2020 22:22:48 +0000 (+0100) Subject: dm crypt: Constify static crypt_iv_operations X-Git-Tag: accepted/tizen/unified/20230118.172025~8149^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8dc79d1bdda0c048bfc7d39a8146c6db1c36ef6;p=platform%2Fkernel%2Flinux-rpi.git dm crypt: Constify static crypt_iv_operations The only usage of these structs is to assign their address to the iv_gen_ops field in the crypt config struct, which is a pointer to const. Make them const like the rest of the static crypt_iv_operations structs. This allows the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn Signed-off-by: Mike Snitzer --- diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 392337f..5379113 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1090,16 +1090,16 @@ static const struct crypt_iv_operations crypt_iv_tcw_ops = { .post = crypt_iv_tcw_post }; -static struct crypt_iv_operations crypt_iv_random_ops = { +static const struct crypt_iv_operations crypt_iv_random_ops = { .generator = crypt_iv_random_gen }; -static struct crypt_iv_operations crypt_iv_eboiv_ops = { +static const struct crypt_iv_operations crypt_iv_eboiv_ops = { .ctr = crypt_iv_eboiv_ctr, .generator = crypt_iv_eboiv_gen }; -static struct crypt_iv_operations crypt_iv_elephant_ops = { +static const struct crypt_iv_operations crypt_iv_elephant_ops = { .ctr = crypt_iv_elephant_ctr, .dtr = crypt_iv_elephant_dtr, .init = crypt_iv_elephant_init,