diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-02-23 20:19:50 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-02-23 21:40:17 +0100 |
commit | 79809d6cdc3a1e4dfb4466fc0e10040bd069211d (patch) | |
tree | fd511a8ba235b0611dce070b22d52587db14d2f4 /libdm/libdm-report.c | |
parent | 9267e0c5e73b74177fc54dda200f012765b33673 (diff) | |
download | lvm2-79809d6cdc3a1e4dfb4466fc0e10040bd069211d.tar.gz |
cleanup: use sizeof instead of macro.
Keep the buffer size defined at a single place and then use
its sizeof.
Diffstat (limited to 'libdm/libdm-report.c')
-rw-r--r-- | libdm/libdm-report.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index 0163910d3..8250a350a 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -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) { |