summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-09-15 14:14:40 +0300
committerMike Snitzer <snitzer@redhat.com>2021-10-12 20:54:10 +0300
commitec132ef2d1d94d43d9dce1400521526bbed89a8b (patch)
treed6d2027ac62772f83c8f1c1e8dda36841e8ea8c6 /drivers/md
parent2c0468e054c0adb660ac055fc396622ec7235df9 (diff)
downloadlinux-ec132ef2d1d94d43d9dce1400521526bbed89a8b.tar.xz
dm clone: make array 'descs' static
Don't populate the read-only array descs on the stack but instead it static and add extra const. Also makes the object code smaller by 66 bytes: Before: text data bss dec hex filename 42382 11140 512 54034 d312 ./drivers/md/dm-clone-target.o After: text data bss dec hex filename 42220 11236 512 53968 d2d0 ./drivers/md/dm-clone-target.o (gcc version 11.2.0) Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-clone-target.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-clone-target.c b/drivers/md/dm-clone-target.c
index 84dbe08ad205..edd22e4d65df 100644
--- a/drivers/md/dm-clone-target.c
+++ b/drivers/md/dm-clone-target.c
@@ -161,7 +161,7 @@ static const char *clone_device_name(struct clone *clone)
static void __set_clone_mode(struct clone *clone, enum clone_metadata_mode new_mode)
{
- const char *descs[] = {
+ static const char * const descs[] = {
"read-write",
"read-only",
"fail"