Skip to content

Commit e8dc79d

Browse files
rikardfalkebornsnitm
authored andcommitted
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 <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 410fe22 commit e8dc79d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/md/dm-crypt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,16 +1090,16 @@ static const struct crypt_iv_operations crypt_iv_tcw_ops = {
10901090
.post = crypt_iv_tcw_post
10911091
};
10921092

1093-
static struct crypt_iv_operations crypt_iv_random_ops = {
1093+
static const struct crypt_iv_operations crypt_iv_random_ops = {
10941094
.generator = crypt_iv_random_gen
10951095
};
10961096

1097-
static struct crypt_iv_operations crypt_iv_eboiv_ops = {
1097+
static const struct crypt_iv_operations crypt_iv_eboiv_ops = {
10981098
.ctr = crypt_iv_eboiv_ctr,
10991099
.generator = crypt_iv_eboiv_gen
11001100
};
11011101

1102-
static struct crypt_iv_operations crypt_iv_elephant_ops = {
1102+
static const struct crypt_iv_operations crypt_iv_elephant_ops = {
11031103
.ctr = crypt_iv_elephant_ctr,
11041104
.dtr = crypt_iv_elephant_dtr,
11051105
.init = crypt_iv_elephant_init,

0 commit comments

Comments
 (0)