Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wtautological-constant-compare in drivers/md/dm-raid.c #753

Closed
nathanchance opened this issue Oct 24, 2019 · 3 comments
Closed

-Wtautological-constant-compare in drivers/md/dm-raid.c #753

nathanchance opened this issue Oct 24, 2019 · 3 comments
Assignees
Labels
-Wtautological-compare -Wtautological-constant-compare [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.5 This bug was fixed in Linux 5.5

Comments

@nathanchance
Copy link
Member

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.

Patch submitted: https://lore.kernel.org/lkml/20191024202803.47613-1-natechancellor@gmail.com/

@nathanchance nathanchance added [BUG] linux A bug that should be fixed in the mainline kernel. [PATCH] Submitted A patch has been submitted for review -Wtautological-constant-compare labels Oct 24, 2019
@nathanchance nathanchance self-assigned this Oct 24, 2019
fengguang pushed a commit to 0day-ci/linux that referenced this issue Oct 27, 2019
…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#753
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
ruscur pushed a commit to ruscur/linux that referenced this issue Nov 8, 2019
…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#753
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
@nathanchance
Copy link
Member Author

This was apparently picked up...? Never got an email about it and Nick's reviewed-by is missing :/

https://git.kernel.org/next/linux-next/c/35ad035b8398c634d888324a299ec50a84cbc6cc

@nathanchance nathanchance added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Nov 8, 2019
@nickdesaulniers
Copy link
Member

YOLO! (I would've gotten away with it too, if it weren't for you god damned kids and your github!)

@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [FIXED][LINUX] 5.5 This bug was fixed in Linux 5.5 and removed [PATCH] Accepted A submitted patch has been accepted upstream labels Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wtautological-compare -Wtautological-constant-compare [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.5 This bug was fixed in Linux 5.5
Projects
None yet
Development

No branches or pull requests

2 participants