diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-07-16 09:00:46 +0200 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-08-31 20:45:47 +0200 |
commit | 2c4580454fffbf184fdb9292aa19ab1ffc224add (patch) | |
tree | a9857994347042ae7d1709697fcde157ffcb0a38 /drivers/pcmcia/pxa2xx_cm_x270.c | |
parent | btrfs: Remove noused chunk_tree and chunk_objectid from scrub_enumerate_chunk... (diff) | |
download | linux-2c4580454fffbf184fdb9292aa19ab1ffc224add.tar.xz linux-2c4580454fffbf184fdb9292aa19ab1ffc224add.zip |
btrfs: Cleanup for btrfs_calc_num_tolerated_disk_barrier_failures
1: Use ARRAY_SIZE(types) to replace a static-value variant:
int num_types = 4;
2: Use 'continue' on condition to reduce one level tab
if (!XXX) {
code;
...
}
->
if (XXX)
continue;
code;
...
3: Put setting 'num_tolerated_disk_barrier_failures = 2' to
(num_tolerated_disk_barrier_failures > 2) condition to make
make logic neat.
if (num_tolerated_disk_barrier_failures > 0 && XXX)
num_tolerated_disk_barrier_failures = 0;
else if (num_tolerated_disk_barrier_failures > 1) {
if (XXX)
num_tolerated_disk_barrier_failures = 1;
else if (XXX)
num_tolerated_disk_barrier_failures = 2;
->
if (num_tolerated_disk_barrier_failures > 0 && XXX)
num_tolerated_disk_barrier_failures = 0;
if (num_tolerated_disk_barrier_failures > 1 && XXX)
num_tolerated_disk_barrier_failures = ;
if (num_tolerated_disk_barrier_failures > 2 && XXX)
num_tolerated_disk_barrier_failures = 2;
4: Remove comment of:
num_mirrors - 1: if RAID1 or RAID10 is configured and more
than 2 mirrors are used.
which is not fit with code.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'drivers/pcmcia/pxa2xx_cm_x270.c')
0 files changed, 0 insertions, 0 deletions