mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cleanup: use const for sizeof values
This commit is contained in:
parent
ddf3b6e5e3
commit
eaa4882924
@ -74,8 +74,8 @@ int dev_is_used_by_active_lv(struct cmd_context *cmd, struct device *dev, int *u
|
||||
struct dirent *dirent;
|
||||
char *holder_name;
|
||||
unsigned dm_dev_major, dm_dev_minor;
|
||||
size_t lvm_prefix_len = sizeof(UUID_PREFIX) - 1;
|
||||
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 = lvm_prefix_len + 2 * ID_LEN;
|
||||
size_t uuid_len;
|
||||
int used_count = 0;
|
||||
char *used_name = NULL;
|
||||
@ -130,7 +130,7 @@ int dev_is_used_by_active_lv(struct cmd_context *cmd, struct device *dev, int *u
|
||||
if (!device_get_uuid(cmd, dm_dev_major, dm_dev_minor, dm_uuid, sizeof(dm_uuid)))
|
||||
continue;
|
||||
|
||||
if (!strncmp(dm_uuid, UUID_PREFIX, 4))
|
||||
if (!strncmp(dm_uuid, UUID_PREFIX, lvm_prefix_len))
|
||||
used_count++;
|
||||
|
||||
if (used_by_dm_name && !used_name)
|
||||
|
Loading…
Reference in New Issue
Block a user