diff options
author | Eric Biggers <ebiggers@google.com> | 2017-06-22 14:32:45 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2017-08-28 11:47:18 -0400 |
commit | 5916a22b83041b07d63191fe06206ae0fff6ec7a (patch) | |
tree | c1d154dcb136fe8e82e57e40f667557fc276c762 /drivers/md/dm-cache-target.c | |
parent | 3f2e539359bd0e709eb35127dc04df6bf8c3e8de (diff) |
dm: constify argument arrays
The arrays of 'struct dm_arg' are never modified by the device-mapper
core, so constify them so that they are placed in .rodata.
(Exception: the args array in dm-raid cannot be constified because it is
allocated on the stack and modified.)
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-cache-target.c')
-rw-r--r-- | drivers/md/dm-cache-target.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index c5ea03fc7ee1..b0a5503a2fd3 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c | |||
@@ -2306,7 +2306,7 @@ static void init_features(struct cache_features *cf) | |||
2306 | static int parse_features(struct cache_args *ca, struct dm_arg_set *as, | 2306 | static int parse_features(struct cache_args *ca, struct dm_arg_set *as, |
2307 | char **error) | 2307 | char **error) |
2308 | { | 2308 | { |
2309 | static struct dm_arg _args[] = { | 2309 | static const struct dm_arg _args[] = { |
2310 | {0, 2, "Invalid number of cache feature arguments"}, | 2310 | {0, 2, "Invalid number of cache feature arguments"}, |
2311 | }; | 2311 | }; |
2312 | 2312 | ||
@@ -2348,7 +2348,7 @@ static int parse_features(struct cache_args *ca, struct dm_arg_set *as, | |||
2348 | static int parse_policy(struct cache_args *ca, struct dm_arg_set *as, | 2348 | static int parse_policy(struct cache_args *ca, struct dm_arg_set *as, |
2349 | char **error) | 2349 | char **error) |
2350 | { | 2350 | { |
2351 | static struct dm_arg _args[] = { | 2351 | static const struct dm_arg _args[] = { |
2352 | {0, 1024, "Invalid number of policy arguments"}, | 2352 | {0, 1024, "Invalid number of policy arguments"}, |
2353 | }; | 2353 | }; |
2354 | 2354 | ||