diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2014-04-04 21:10:30 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2014-04-08 11:00:15 +0200 |
commit | 5553a099d1a6f0c8e3421712517d41ef820a5964 (patch) | |
tree | 4828d6e89f9b2144c1a69cac2670d28bf3e3feb2 /lib/thin | |
parent | 56175f6ba96d161a1d8f70bf985d95066b41d2d9 (diff) | |
download | lvm2-5553a099d1a6f0c8e3421712517d41ef820a5964.tar.gz |
cleanup: use DM_ARRAY_SIZE
More use of libdevmapper macro
Diffstat (limited to 'lib/thin')
-rw-r--r-- | lib/thin/thin.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/thin/thin.c b/lib/thin/thin.c index ff4eafde4..d4bde8b7b 100644 --- a/lib/thin/thin.c +++ b/lib/thin/thin.c @@ -653,7 +653,7 @@ static int _thin_target_present(struct cmd_context *cmd, return 0; } - for (i = 0; i < sizeof(_features)/sizeof(*_features); i++) + for (i = 0; i < DM_ARRAY_SIZE(_features); ++i) if ((maj > _features[i].maj) || (maj == _features[i].maj && min >= _features[i].min)) _attrs |= _features[i].thin_feature; @@ -678,13 +678,13 @@ static int _thin_target_present(struct cmd_context *cmd, str = cv->v.str; if (!*str) continue; - for (i = 0; i < sizeof(_features)/sizeof(*_features); i++) + for (i = 0; i < DM_ARRAY_SIZE(_features); ++i) if (strcasecmp(str, _features[i].feature) == 0) _feature_mask |= _features[i].thin_feature; } } _feature_mask = ~_feature_mask; - for (i = 0; i < sizeof(_features)/sizeof(*_features); i++) + for (i = 0; i < DM_ARRAY_SIZE(_features); ++i) if ((_attrs & _features[i].thin_feature) && !(_feature_mask & _features[i].thin_feature)) log_very_verbose("Target %s %s support disabled by %s", @@ -757,7 +757,7 @@ int init_multiple_segtypes(struct cmd_context *cmd, struct segtype_library *segl struct segment_type *segtype; unsigned i; - for (i = 0; i < sizeof(reg_segtypes)/sizeof(reg_segtypes[0]); ++i) { + for (i = 0; i < DM_ARRAY_SIZE(reg_segtypes); ++i) { segtype = dm_zalloc(sizeof(*segtype)); if (!segtype) { |