]> sourceware.org Git - lvm2.git/commitdiff
const: drop static keyword
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 3 May 2024 17:43:21 +0000 (19:43 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 3 May 2024 23:01:57 +0000 (01:01 +0200)
We don't need relocatable space to store 'const' number.

device_mapper/libdm-report.c
lib/device/dev-cache.c
lib/mm/memlock.c
libdm/libdm-report.c

index 24d350db57171d5e1488bcb76c43a274bacf2b46..4973acd4527569739e1e0a13d7828cf4209f6812 100644 (file)
@@ -2568,12 +2568,12 @@ static int _check_reserved_values_supported(const struct dm_report_field_type fi
        const struct dm_report_reserved_value *iter;
        const struct dm_report_field_reserved_value *field_res;
        const struct dm_report_field_type *field;
-       static uint32_t supported_reserved_types = DM_REPORT_FIELD_TYPE_NUMBER |
+       const uint32_t supported_reserved_types =  DM_REPORT_FIELD_TYPE_NUMBER |
                                                   DM_REPORT_FIELD_TYPE_SIZE |
                                                   DM_REPORT_FIELD_TYPE_PERCENT |
                                                   DM_REPORT_FIELD_TYPE_STRING |
                                                   DM_REPORT_FIELD_TYPE_TIME;
-       static uint32_t supported_reserved_types_with_range = DM_REPORT_FIELD_RESERVED_VALUE_RANGE |
+       const uint32_t supported_reserved_types_with_range =  DM_REPORT_FIELD_RESERVED_VALUE_RANGE |
                                                              DM_REPORT_FIELD_TYPE_NUMBER |
                                                              DM_REPORT_FIELD_TYPE_SIZE |
                                                              DM_REPORT_FIELD_TYPE_PERCENT |
index e6f4ec8863ce28b28555cd71cc23e2ffebc959c0..3269a42acd3dc323ff0a6e06a8196d6365dcd7d8 100644 (file)
@@ -550,8 +550,8 @@ static struct device *_get_device_for_sysfs_dev_name_using_devno(const char *dev
 
 static int _get_vgid_and_lvid_for_dev(struct device *dev)
 {
-       static size_t lvm_prefix_len = sizeof(UUID_PREFIX) - 1;
-       static size_t lvm_uuid_len = sizeof(UUID_PREFIX) - 1 + 2 * ID_LEN;
+       const size_t lvm_prefix_len = sizeof(UUID_PREFIX) - 1;
+       const size_t lvm_uuid_len = sizeof(UUID_PREFIX) - 1 + 2 * ID_LEN;
        char uuid[DM_UUID_LEN];
        size_t uuid_len;
 
index 33e8c2b9c21ba8864f486417618c183d1137aa07..815ddfa3ac8b2f1c4c18e17945d6153dbdd2e82d 100644 (file)
@@ -77,7 +77,7 @@ int memlock_count_daemon(void)
 
 static size_t _size_stack;
 static size_t _size_malloc_tmp;
-static size_t _size_malloc = 2000000;
+const size_t _size_malloc = 2000000;
 
 static void *_malloc_mem = NULL;
 static int _mem_locked = 0;
index d37bfceb03811b09b5cc68670d2c5b8400135a13..78dcc54b3e3eb36c2f21b6569a69e7c0978e1a92 100644 (file)
@@ -2566,12 +2566,12 @@ static int _check_reserved_values_supported(const struct dm_report_field_type fi
        const struct dm_report_reserved_value *iter;
        const struct dm_report_field_reserved_value *field_res;
        const struct dm_report_field_type *field;
-       static uint32_t supported_reserved_types = DM_REPORT_FIELD_TYPE_NUMBER |
+       const uint32_t supported_reserved_types =  DM_REPORT_FIELD_TYPE_NUMBER |
                                                   DM_REPORT_FIELD_TYPE_SIZE |
                                                   DM_REPORT_FIELD_TYPE_PERCENT |
                                                   DM_REPORT_FIELD_TYPE_STRING |
                                                   DM_REPORT_FIELD_TYPE_TIME;
-       static uint32_t supported_reserved_types_with_range = DM_REPORT_FIELD_RESERVED_VALUE_RANGE |
+       const uint32_t supported_reserved_types_with_range =  DM_REPORT_FIELD_RESERVED_VALUE_RANGE |
                                                              DM_REPORT_FIELD_TYPE_NUMBER |
                                                              DM_REPORT_FIELD_TYPE_SIZE |
                                                              DM_REPORT_FIELD_TYPE_PERCENT |
This page took 0.041446 seconds and 5 git commands to generate.