Skip to content

Commit 6cc435f

Browse files
mauelshaMike Snitzer
authored andcommitted
dm: avoid 'do {} while(0)' loop in single statement macros
Signed-off-by: Heinz Mauelshagen <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent dcdd467 commit 6cc435f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

drivers/md/dm-integrity.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ struct journal_entry {
113113
#endif
114114
#define journal_entry_get_sector(je) le64_to_cpu((je)->u.sector)
115115
#define journal_entry_is_unused(je) ((je)->u.s.sector_hi == cpu_to_le32(-1))
116-
#define journal_entry_set_unused(je) do { ((je)->u.s.sector_hi = cpu_to_le32(-1)); } while (0)
116+
#define journal_entry_set_unused(je) ((je)->u.s.sector_hi = cpu_to_le32(-1))
117117
#define journal_entry_is_inprogress(je) ((je)->u.s.sector_hi == cpu_to_le32(-2))
118-
#define journal_entry_set_inprogress(je) do { ((je)->u.s.sector_hi = cpu_to_le32(-2)); } while (0)
118+
#define journal_entry_set_inprogress(je) ((je)->u.s.sector_hi = cpu_to_le32(-2))
119119

120120
#define JOURNAL_BLOCK_SECTORS 8
121121
#define JOURNAL_SECTOR_DATA ((1 << SECTOR_SHIFT) - sizeof(commit_id_t))

drivers/md/dm-mpath.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,13 +472,11 @@ static struct pgpath *choose_pgpath(struct multipath *m, size_t nr_bytes)
472472
* it has been invoked.
473473
*/
474474
#define dm_report_EIO(m) \
475-
do { \
476475
DMDEBUG_LIMIT("%s: returning EIO; QIFNP = %d; SQIFNP = %d; DNFS = %d", \
477476
dm_table_device_name((m)->ti->table), \
478477
test_bit(MPATHF_QUEUE_IF_NO_PATH, &(m)->flags), \
479478
test_bit(MPATHF_SAVED_QUEUE_IF_NO_PATH, &(m)->flags), \
480-
dm_noflush_suspending((m)->ti)); \
481-
} while (0)
479+
dm_noflush_suspending((m)->ti))
482480

483481
/*
484482
* Check whether bios must be queued in the device-mapper core rather

0 commit comments

Comments
 (0)