Skip to content

Commit 7f61f5a

Browse files
JoePerchessnitm
authored andcommitted
dm table: use bool function return values of true/false not 1/0
Use the normal return values for bool functions. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 65ff5b7 commit 7f61f5a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/md/dm-table.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,14 +1336,14 @@ static bool dm_table_supports_flush(struct dm_table *t, unsigned flush)
13361336
continue;
13371337

13381338
if (ti->flush_supported)
1339-
return 1;
1339+
return true;
13401340

13411341
if (ti->type->iterate_devices &&
13421342
ti->type->iterate_devices(ti, device_flush_capable, &flush))
1343-
return 1;
1343+
return true;
13441344
}
13451345

1346-
return 0;
1346+
return false;
13471347
}
13481348

13491349
static bool dm_table_discard_zeroes_data(struct dm_table *t)
@@ -1356,10 +1356,10 @@ static bool dm_table_discard_zeroes_data(struct dm_table *t)
13561356
ti = dm_table_get_target(t, i++);
13571357

13581358
if (ti->discard_zeroes_data_unsupported)
1359-
return 0;
1359+
return false;
13601360
}
13611361

1362-
return 1;
1362+
return true;
13631363
}
13641364

13651365
static int device_is_nonrot(struct dm_target *ti, struct dm_dev *dev,
@@ -1405,10 +1405,10 @@ static bool dm_table_all_devices_attribute(struct dm_table *t,
14051405

14061406
if (!ti->type->iterate_devices ||
14071407
!ti->type->iterate_devices(ti, func, NULL))
1408-
return 0;
1408+
return false;
14091409
}
14101410

1411-
return 1;
1411+
return true;
14121412
}
14131413

14141414
static int device_not_write_same_capable(struct dm_target *ti, struct dm_dev *dev,
@@ -1465,14 +1465,14 @@ static bool dm_table_supports_discards(struct dm_table *t)
14651465
continue;
14661466

14671467
if (ti->discards_supported)
1468-
return 1;
1468+
return true;
14691469

14701470
if (ti->type->iterate_devices &&
14711471
ti->type->iterate_devices(ti, device_discard_capable, NULL))
1472-
return 1;
1472+
return true;
14731473
}
14741474

1475-
return 0;
1475+
return false;
14761476
}
14771477

14781478
void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,

0 commit comments

Comments
 (0)