Skip to content

Commit ec132ef

Browse files
Colin Ian Kingsnitm
authored andcommitted
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 <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 2c0468e commit ec132ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/dm-clone-target.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static const char *clone_device_name(struct clone *clone)
161161

162162
static void __set_clone_mode(struct clone *clone, enum clone_metadata_mode new_mode)
163163
{
164-
const char *descs[] = {
164+
static const char * const descs[] = {
165165
"read-write",
166166
"read-only",
167167
"fail"

0 commit comments

Comments
 (0)