Skip to content

Commit

Permalink
dm raid: Remove unnecessary negation of a shift in raid10_format_to_m…
Browse files Browse the repository at this point in the history
…d_layout

When building with Clang + -Wtautological-constant-compare:

 drivers/md/dm-raid.c:619:8: warning: converting the result of '<<' to a
 boolean always evaluates to true [-Wtautological-constant-compare]
                 r = !RAID10_OFFSET;
                      ^
 drivers/md/dm-raid.c:517:28: note: expanded from macro 'RAID10_OFFSET'
 #define RAID10_OFFSET                   (1 << 16) /* stripes with data
 copies area adjacent on devices */
                                           ^
 1 warning generated.

Negating a non-zero number will always make it zero, which is the
default value of r in this function so this statement is unnecessary;
remove it so that clang no longer warns.

Link: ClangBuiltLinux/linux#753
Signed-off-by: Nathan Chancellor <[email protected]>
Acked-by: Heinz Mauelshagen <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
  • Loading branch information
nathanchance authored and snitm committed Nov 7, 2019
1 parent e7fad90 commit 35ad035
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/md/dm-raid.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ static int raid10_format_to_md_layout(struct raid_set *rs,

} else if (algorithm == ALGORITHM_RAID10_FAR) {
f = copies;
r = !RAID10_OFFSET;
if (!test_bit(__CTR_FLAG_RAID10_USE_NEAR_SETS, &rs->ctr_flags))
r |= RAID10_USE_FAR_SETS;

Expand Down

0 comments on commit 35ad035

Please sign in to comment.