1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cleanup: use sizeof instead of macro.

Keep the buffer size defined at a single place and then use
its sizeof.
This commit is contained in:
Zdenek Kabelac 2016-02-23 20:19:50 +01:00
parent 9267e0c5e7
commit 79809d6cdc

View File

@ -889,7 +889,7 @@ static void _all_match_combine(const struct dm_report_object_type *types,
const struct dm_report_object_type *t;
size_t prefix_len;
if (!_get_canonical_field_name(field, flen, field_canon, DM_REPORT_FIELD_TYPE_ID_LEN, NULL))
if (!_get_canonical_field_name(field, flen, field_canon, sizeof(field_canon), NULL))
return;
flen = strlen(field_canon);
@ -949,7 +949,7 @@ static int _get_field(struct dm_report *rh, const char *field, size_t flen,
if (!flen)
return 0;
if (!_get_canonical_field_name(field, flen, field_canon, DM_REPORT_FIELD_TYPE_ID_LEN, NULL))
if (!_get_canonical_field_name(field, flen, field_canon, sizeof(field_canon), NULL))
return_0;
for (f = 0; _implicit_report_fields[f].report_fn; f++) {
@ -1063,7 +1063,7 @@ static int _key_match(struct dm_report *rh, const char *key, size_t len,
return 0;
}
if (!_get_canonical_field_name(key, len, key_canon, DM_REPORT_FIELD_TYPE_ID_LEN, NULL))
if (!_get_canonical_field_name(key, len, key_canon, sizeof(key_canon), NULL))
return_0;
for (f = 0; _implicit_report_fields[f].report_fn; f++)
@ -1196,7 +1196,7 @@ static int _canonicalize_field_ids(struct dm_report *rh)
for (i = 0; i < registered_field_count; i++) {
if (!_get_canonical_field_name(rh->fields[i].id, strlen(rh->fields[i].id),
canonical_field, DM_REPORT_FIELD_TYPE_ID_LEN, &differs))
canonical_field, sizeof(canonical_field), &differs))
return_0;
if (differs) {