1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-24 17:57:48 +03:00

cleanup: correcting macro wrapping

Use proper do {} while(0) so ';' after macros are correctly
interpretted..
This commit is contained in:
Zdenek Kabelac 2018-04-19 17:35:48 +02:00
parent 9731d48691
commit 73cda0437f

View File

@ -71,12 +71,12 @@ int lv_merge_segments(struct logical_volume *lv)
if (error_count++ > ERROR_MAX) \ if (error_count++ > ERROR_MAX) \
goto out goto out
#define seg_error(msg) { \ #define seg_error(msg) do { \
log_error("LV %s, segment %u invalid: %s for %s segment.", \ log_error("LV %s, segment %u invalid: %s for %s segment.", \
seg->lv->name, seg_count, (msg), lvseg_name(seg)); \ seg->lv->name, seg_count, (msg), lvseg_name(seg)); \
if ((*error_count)++ > ERROR_MAX) \ if ((*error_count)++ > ERROR_MAX) \
return; \ return; \
} } while (0)
/* /*
* RAID segment property checks. * RAID segment property checks.
@ -84,19 +84,19 @@ int lv_merge_segments(struct logical_volume *lv)
* Checks in here shall catch any * Checks in here shall catch any
* bogus segment structure setup. * bogus segment structure setup.
*/ */
#define raid_seg_error(msg) { \ #define raid_seg_error(msg) do { \
log_error("LV %s invalid: %s for %s segment", \ log_error("LV %s invalid: %s for %s segment", \
seg->lv->name, (msg), lvseg_name(seg)); \ seg->lv->name, (msg), lvseg_name(seg)); \
if ((*error_count)++ > ERROR_MAX) \ if ((*error_count)++ > ERROR_MAX) \
return; \ return; \
} } while (0)
#define raid_seg_error_val(msg, val) { \ #define raid_seg_error_val(msg, val) do { \
log_error("LV %s invalid: %s (is %u) for %s segment", \ log_error("LV %s invalid: %s (is %u) for %s segment", \
seg->lv->name, (msg), (val), lvseg_name(seg)); \ seg->lv->name, (msg), (val), lvseg_name(seg)); \
if ((*error_count)++ > ERROR_MAX) \ if ((*error_count)++ > ERROR_MAX) \
return; \ return; \
} } while(0)
/* Check segment LV for reshape flags. */ /* Check segment LV for reshape flags. */
static int _check_raid_seg_reshape_flags(struct lv_segment *seg) static int _check_raid_seg_reshape_flags(struct lv_segment *seg)
@ -354,7 +354,7 @@ static void _check_lv_segment(struct logical_volume *lv, struct lv_segment *seg,
case CACHE_MODE_PASSTHROUGH: case CACHE_MODE_PASSTHROUGH:
break; break;
default: default:
seg_error("has invalid cache's feature flag") seg_error("has invalid cache's feature flag");
} }
if (!seg->policy_name) if (!seg->policy_name)
seg_error("is missing cache policy name"); seg_error("is missing cache policy name");