1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

libdm: enclose dm_stats_walk_do/while() body in do..while

The call to dm_stats_walk_start() before the do statement makes
dm_stats_walk_do() behave inconsistently depending on context;
wrap them in an additional do { } while (0) so that the macro
always expands to a valid statement.
This commit is contained in:
Bryn M. Reeves 2016-07-07 21:28:35 +01:00
parent 6233bcf52d
commit 5e06b33c51

View File

@ -1146,6 +1146,7 @@ for (dm_stats_walk_init((dms), DM_STATS_WALK_GROUP), \
* empty. * empty.
*/ */
#define dm_stats_walk_do(dms) \ #define dm_stats_walk_do(dms) \
do { \
dm_stats_walk_start((dms)); \ dm_stats_walk_start((dms)); \
do do
@ -1154,7 +1155,8 @@ do
* regions contained in dm_stats handle 'dms'. * regions contained in dm_stats handle 'dms'.
*/ */
#define dm_stats_walk_while(dms) \ #define dm_stats_walk_while(dms) \
while(!dm_stats_walk_end((dms))) while(!dm_stats_walk_end((dms))); \
} while (0)
/* /*
* Cursor relative property methods * Cursor relative property methods