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

-Wpointer-bool-conversion in sound/soc/codecs/wcd934x.c #854

Closed
nathanchance opened this issue Feb 4, 2020 · 2 comments
Closed

-Wpointer-bool-conversion in sound/soc/codecs/wcd934x.c #854

nathanchance opened this issue Feb 4, 2020 · 2 comments
Assignees
Labels
-Wpointer-bool-conversion [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.7 This bug was fixed in Linux 5.7

Comments

@nathanchance
Copy link
Member

../sound/soc/codecs/wcd934x.c:1886:11: warning: address of array 'wcd->rx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (wcd->rx_chs) {
        ~~  ~~~~~^~~~~~
../sound/soc/codecs/wcd934x.c:1894:11: warning: address of array 'wcd->tx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (wcd->tx_chs) {
        ~~  ~~~~~^~~~~~
2 warnings generated.

We never saw this in -next because a dependency patch never made it into -next but went straight to mainline :(

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

@nathanchance nathanchance added [BUG] linux A bug that should be fixed in the mainline kernel. -Wpointer-bool-conversion [PATCH] Submitted A patch has been submitted for review labels Feb 4, 2020
@nathanchance nathanchance self-assigned this Feb 4, 2020
fengguang pushed a commit to 0day-ci/linux that referenced this issue Feb 4, 2020
Clang warns:

../sound/soc/codecs/wcd934x.c:1886:11: warning: address of array
'wcd->rx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (wcd->rx_chs) {
        ~~  ~~~~~^~~~~~
../sound/soc/codecs/wcd934x.c:1894:11: warning: address of array
'wcd->tx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (wcd->tx_chs) {
        ~~  ~~~~~^~~~~~
2 warnings generated.

Arrays that are in the middle of a struct are never NULL so they don't
need a check like this.

Fixes: a61f3b4 ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec")
Link: ClangBuiltLinux#854
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
@nickdesaulniers nickdesaulniers added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Feb 11, 2020
fengguang pushed a commit to 0day-ci/linux that referenced this issue Feb 11, 2020
Clang warns:

../sound/soc/codecs/wcd934x.c:1886:11: warning: address of array
'wcd->rx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (wcd->rx_chs) {
        ~~  ~~~~~^~~~~~
../sound/soc/codecs/wcd934x.c:1894:11: warning: address of array
'wcd->tx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (wcd->tx_chs) {
        ~~  ~~~~~^~~~~~
2 warnings generated.

Arrays that are in the middle of a struct are never NULL so they don't
need a check like this.

Fixes: a61f3b4 ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec")
Link: ClangBuiltLinux#854
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://lore.kernel.org/r/20200204060143.23393-1-natechancellor@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
krasCGQ pushed a commit to krasCGQ/linux that referenced this issue Apr 2, 2020
Clang warns:

../sound/soc/codecs/wcd934x.c:1886:11: warning: address of array
'wcd->rx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (wcd->rx_chs) {
        ~~  ~~~~~^~~~~~
../sound/soc/codecs/wcd934x.c:1894:11: warning: address of array
'wcd->tx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (wcd->tx_chs) {
        ~~  ~~~~~^~~~~~
2 warnings generated.

Arrays that are in the middle of a struct are never NULL so they don't
need a check like this.

Fixes: a61f3b4 ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec")
Link: ClangBuiltLinux/linux#854
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://lore.kernel.org/r/20200204060143.23393-1-natechancellor@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://git.kernel.org/broonie/sound/c/918d0aba86ed8c1f4ff7f39e39e5c1b46fff2bc2
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Albert I <kras@raphielgang.org>
krasCGQ pushed a commit to krasCGQ/linux that referenced this issue Apr 2, 2020
Clang warns:

../sound/soc/codecs/wcd934x.c:1886:11: warning: address of array
'wcd->rx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (wcd->rx_chs) {
        ~~  ~~~~~^~~~~~
../sound/soc/codecs/wcd934x.c:1894:11: warning: address of array
'wcd->tx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (wcd->tx_chs) {
        ~~  ~~~~~^~~~~~
2 warnings generated.

Arrays that are in the middle of a struct are never NULL so they don't
need a check like this.

Fixes: a61f3b4 ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec")
Link: ClangBuiltLinux/linux#854
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://lore.kernel.org/r/20200204060143.23393-1-natechancellor@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://git.kernel.org/broonie/sound/c/918d0aba86ed8c1f4ff7f39e39e5c1b46fff2bc2
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Albert I <kras@raphielgang.org>
@nathanchance
Copy link
Member Author

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

No branches or pull requests

2 participants