From efe2005022239944a3d36bc3d9ba061333306a56 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 3 May 2024 19:43:21 +0200 Subject: [PATCH] const: drop static keyword We don't need relocatable space to store 'const' number. --- device_mapper/libdm-report.c | 4 ++-- lib/device/dev-cache.c | 4 ++-- lib/mm/memlock.c | 2 +- libdm/libdm-report.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/device_mapper/libdm-report.c b/device_mapper/libdm-report.c index 24d350db5..4973acd45 100644 --- a/device_mapper/libdm-report.c +++ b/device_mapper/libdm-report.c @@ -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 | diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c index e6f4ec886..3269a42ac 100644 --- a/lib/device/dev-cache.c +++ b/lib/device/dev-cache.c @@ -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; diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c index 33e8c2b9c..815ddfa3a 100644 --- a/lib/mm/memlock.c +++ b/lib/mm/memlock.c @@ -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; diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index d37bfceb0..78dcc54b3 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -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 |