Skip to contentSkip to conversation

rtw88: fix fw dump support detection

PATCH\ net Arnd Bergmann 3 participants 3 messages Oct 26, 2020 – Nov 2, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

From: Arnd Bergmann <[email protected]>

clang points out a useless check that was recently added:

drivers/net/wireless/realtek/rtw88/fw.c:1485:21: warning: address of array 'rtwdev->chip->fw_fifo_addr' will always evaluate to 'true' [-Wpointer-bool-conversion]

        if (!rtwdev->chip->fw_fifo_addr) {
            ~~~~~~~~~~~~~~~^~~~~~~~~~~~

Apparently this was meant to check the contents of the array rather than the address, so check it accordingly.

Fixes 0fbc2f0f34cc ("rtw88: add dump firmware fifo support")
---
 drivers/net/wireless/realtek/rtw88/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/fw.c +1 -1
index 042015bc8055..b2fd87834f23 100644
@@ -1482,7 +1482,7 @@ static bool rtw_fw_dump_check_size(struct rtw_dev *rtwdev,
 int rtw_fw_dump_fifo(struct rtw_dev *rtwdev, u8 fifo_sel, u32 addr, u32 size,
 		     u32 *buffer)
 {
-	if (!rtwdev->chip->fw_fifo_addr) {
+	if (!rtwdev->chip->fw_fifo_addr[0]) {
 		rtw_dbg(rtwdev, RTW_DBG_FW, "chip not support dump fw fifo\n");
 		return -ENOTSUPP;
 	}
Signature · 1 line
2.27.0
Reviewed-by
#1 lore raw
Quoted 33 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

clang points out a useless check that was recently added:

drivers/net/wireless/realtek/rtw88/fw.c:1485:21: warning: address of array 'rtwdev->chip->fw_fifo_addr' will always evaluate to 'true' [-Wpointer-bool-conversion]

        if (!rtwdev->chip->fw_fifo_addr) {
            ~~~~~~~~~~~~~~~^~~~~~~~~~~~

Apparently this was meant to check the contents of the array rather than the address, so check it accordingly.

Fixes 0fbc2f0f34cc ("rtw88: add dump firmware fifo support")
---
 drivers/net/wireless/realtek/rtw88/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/fw.c +1 -1
index 042015bc8055..b2fd87834f23 100644
@@ -1482,7 +1482,7 @@ static bool rtw_fw_dump_check_size(struct rtw_dev *rtwdev,
 int rtw_fw_dump_fifo(struct rtw_dev *rtwdev, u8 fifo_sel, u32 addr, u32 size,
 		     u32 *buffer)
 {
-	if (!rtwdev->chip->fw_fifo_addr) {
+	if (!rtwdev->chip->fw_fifo_addr[0]) {
 		rtw_dbg(rtwdev, RTW_DBG_FW, "chip not support dump fw fifo\n");
 		return -ENOTSUPP;
 	}
Signature · 1 line
2.27.0

Tom sent an identical patch earlier that it does not look like Kalle has picked up:

https://lore.kernel.org/linux-wireless/[email protected]/

Not that it particularly matters which one goes in so regardless:

#2 lore raw
In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

clang points out a useless check that was recently added:

drivers/net/wireless/realtek/rtw88/fw.c:1485:21: warning: address of array 'rtwdev->chip->fw_fifo_addr' will always evaluate to 'true' [-Wpointer-bool-conversion]

        if (!rtwdev->chip->fw_fifo_addr) {
            ~~~~~~~~~~~~~~~^~~~~~~~~~~~
Quoted 6 lines

Apparently this was meant to check the contents of the array rather than the address, so check it accordingly.

Fixes 0fbc2f0f34cc ("rtw88: add dump firmware fifo support")

I'll take Tom's patch as it was first.

Patch set to Superseded.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches