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

-Wsometimes-uninitialized in drivers/iio/adc/stmpe-adc.c #387

Closed
nickdesaulniers opened this issue Feb 26, 2019 · 4 comments
Closed

-Wsometimes-uninitialized in drivers/iio/adc/stmpe-adc.c #387

nickdesaulniers opened this issue Feb 26, 2019 · 4 comments
Assignees
Labels
-Wsometimes-uninitialized [ARCH] arm32 This bug impacts ARCH=arm [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] 5.2 This bug was fixed in Linux 5.2

Comments

@nickdesaulniers
Copy link
Member

from #381

drivers/iio/adc/stmpe-adc.c:204:13: error: variable 'data' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
@nickdesaulniers nickdesaulniers added good first issue Good for newcomers [BUG] linux A bug that should be fixed in the mainline kernel. low priority This bug is not critical and not a priority [ARCH] arm32 This bug impacts ARCH=arm -Wsometimes-uninitialized [BUG] linux-next This is an issue only seen in linux-next and removed [BUG] linux A bug that should be fixed in the mainline kernel. labels Feb 26, 2019
@nickdesaulniers
Copy link
Member Author

driver does not exist yet in mainline.

again (same pattern as #388), separated conditionals Clang can't provide all cases exhausted. The early return could just be a final else clause.

@nathanchance
Copy link
Member

@nathanchance nathanchance self-assigned this Mar 7, 2019
@nathanchance nathanchance added [PATCH] Submitted A patch has been submitted for review and removed good first issue Good for newcomers low priority This bug is not critical and not a priority labels Mar 7, 2019
@nathanchance
Copy link
Member

@nathanchance nathanchance added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Mar 20, 2019
fengguang pushed a commit to 0day-ci/linux that referenced this issue Apr 4, 2019
When building with -Wsometimes-uninitialized, Clang warns:

drivers/iio/adc/stmpe-adc.c:204:13: warning: variable 'data' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

Clang can't tell that data will never be used uninitialized because the
two if statements take care of all cases. Remove the first if statement
and make it the else branch of the second one so that it is apparent to
Clang that all cases are covered.

Link: ClangBuiltLinux#387
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: NIck Desaulniers <ndesaulniers@google.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
fengguang pushed a commit to 0day-ci/linux that referenced this issue Apr 5, 2019
When building with -Wsometimes-uninitialized, Clang warns:

drivers/iio/adc/stmpe-adc.c:204:13: warning: variable 'data' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

Clang can't tell that data will never be used uninitialized because the
two if statements take care of all cases. Remove the first if statement
and make it the else branch of the second one so that it is apparent to
Clang that all cases are covered.

Link: ClangBuiltLinux#387
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: NIck Desaulniers <ndesaulniers@google.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
@nathanchance
Copy link
Member

@nathanchance nathanchance added [FIXED][LINUX] 5.2 This bug was fixed in Linux 5.2 and removed [PATCH] Accepted A submitted patch has been accepted upstream labels May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wsometimes-uninitialized [ARCH] arm32 This bug impacts ARCH=arm [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] 5.2 This bug was fixed in Linux 5.2
Projects
None yet
Development

No branches or pull requests

2 participants