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 drivers/net/dsa/sja1105/sja1105_main.c #1139

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

Comments

@nathanchance
Copy link
Member

drivers/net/dsa/sja1105/sja1105_main.c:3418:38: warning: address of array 'match->compatible' will always evaluate to 'true' [-Wpointer-bool-conversion]
        for (match = sja1105_dt_ids; match->compatible; match++) {
        ~~~                          ~~~~~~~^~~~~~~~~~
1 warning generated.

Patch submitted: https://lore.kernel.org/r/20200821222515.414167-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 Aug 21, 2020
@nathanchance nathanchance self-assigned this Aug 21, 2020
fengguang pushed a commit to 0day-ci/linux that referenced this issue Aug 21, 2020
…_check_device_id

Clang warns:

drivers/net/dsa/sja1105/sja1105_main.c:3418:38: warning: address of
array 'match->compatible' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        for (match = sja1105_dt_ids; match->compatible; match++) {
        ~~~                          ~~~~~~~^~~~~~~~~~
1 warning generated.

We should check the value of the first character in compatible to see if
it is empty or not. This matches how the rest of the tree iterates over
IDs.

Fixes: 0b0e299 ("net: dsa: sja1105: use detected device id instead of DT one on mismatch")
Link: ClangBuiltLinux#1139
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
mingkaihu pushed a commit to nxp-archive/openil_linux that referenced this issue Aug 24, 2020
…_check_device_id

Clang warns:

drivers/net/dsa/sja1105/sja1105_main.c:3418:38: warning: address of
array 'match->compatible' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        for (match = sja1105_dt_ids; match->compatible; match++) {
        ~~~                          ~~~~~~~^~~~~~~~~~
1 warning generated.

We should check the value of the first character in compatible to see if
it is empty or not. This matches how the rest of the tree iterates over
IDs.

Fixes: 0b0e299720bb ("net: dsa: sja1105: use detected device id instead of DT one on mismatch")
Link: ClangBuiltLinux/linux#1139
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Aug 25, 2020
idosch pushed a commit to jpirko/linux_mlxsw that referenced this issue Aug 25, 2020
…_check_device_id

Clang warns:

drivers/net/dsa/sja1105/sja1105_main.c:3418:38: warning: address of
array 'match->compatible' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        for (match = sja1105_dt_ids; match->compatible; match++) {
        ~~~                          ~~~~~~~^~~~~~~~~~
1 warning generated.

We should check the value of the first character in compatible to see if
it is empty or not. This matches how the rest of the tree iterates over
IDs.

Fixes: 0b0e299 ("net: dsa: sja1105: use detected device id instead of DT one on mismatch")
Link: ClangBuiltLinux/linux#1139
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [FIXED][LINUX] 5.9 This bug was fixed in Linux 5.9 and removed [PATCH] Accepted A submitted patch has been accepted upstream labels Aug 27, 2020
larrygwinn pushed a commit to nxp-auto-linux/linux that referenced this issue Aug 12, 2022
…_check_device_id

Clang warns:

drivers/net/dsa/sja1105/sja1105_main.c:3418:38: warning: address of
array 'match->compatible' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        for (match = sja1105_dt_ids; match->compatible; match++) {
        ~~~                          ~~~~~~~^~~~~~~~~~
1 warning generated.

We should check the value of the first character in compatible to see if
it is empty or not. This matches how the rest of the tree iterates over
IDs.

Fixes: 0b0e299 ("net: dsa: sja1105: use detected device id instead of DT one on mismatch")
Link: ClangBuiltLinux/linux#1139
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5978fac)
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
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.9 This bug was fixed in Linux 5.9
Projects
None yet
Development

No branches or pull requests

1 participant