Skip to content

Commit a8fa648

Browse files
author
Mikulas Patocka
committed
dm integrity: fix gcc 5 warning
This commit fixes gcc 5 warning "logical not is only applied to the left hand side of comparison" Reported-by: Geert Uytterhoeven <[email protected]> Fixes: fb09876 ("dm-integrity: introduce the Inline mode") Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 26207c6 commit a8fa648

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/md/dm-integrity.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4715,13 +4715,18 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv
47154715
ti->error = "Block size doesn't match the information in superblock";
47164716
goto bad;
47174717
}
4718-
if (!le32_to_cpu(ic->sb->journal_sections) != (ic->mode == 'I')) {
4719-
r = -EINVAL;
4720-
if (ic->mode != 'I')
4718+
if (ic->mode != 'I') {
4719+
if (!le32_to_cpu(ic->sb->journal_sections)) {
4720+
r = -EINVAL;
47214721
ti->error = "Corrupted superblock, journal_sections is 0";
4722-
else
4722+
goto bad;
4723+
}
4724+
} else {
4725+
if (le32_to_cpu(ic->sb->journal_sections)) {
4726+
r = -EINVAL;
47234727
ti->error = "Corrupted superblock, journal_sections is not 0";
4724-
goto bad;
4728+
goto bad;
4729+
}
47254730
}
47264731
/* make sure that ti->max_io_len doesn't overflow */
47274732
if (!ic->meta_dev) {

0 commit comments

Comments
 (0)