linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH\ net] rtw88: fix fw dump support detection
@ 2020-10-26 21:22 Arnd Bergmann
  2020-10-27  1:39 ` Nathan Chancellor
  2020-11-02 18:13 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2020-10-26 21:22 UTC (permalink / raw)
  To: Yan-Hsuan Chuang, Kalle Valo, David S. Miller, Jakub Kicinski
  Cc: Arnd Bergmann, Nathan Chancellor, Nick Desaulniers, Tzu-En Huang,
	Ping-Ke Shih, Chin-Yen Lee, Kai-Heng Feng, linux-wireless,
	netdev, linux-kernel, clang-built-linux

From: Arnd Bergmann <arnd@arndb.de>

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/wireless/realtek/rtw88/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
index 042015bc8055..b2fd87834f23 100644
--- a/drivers/net/wireless/realtek/rtw88/fw.c
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
@@ -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;
 	}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH\ net] rtw88: fix fw dump support detection
  2020-10-26 21:22 [PATCH\ net] rtw88: fix fw dump support detection Arnd Bergmann
@ 2020-10-27  1:39 ` Nathan Chancellor
  2020-11-02 18:13 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2020-10-27  1:39 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Yan-Hsuan Chuang, Kalle Valo, David S. Miller, Jakub Kicinski,
	Arnd Bergmann, Nick Desaulniers, Tzu-En Huang, Ping-Ke Shih,
	Chin-Yen Lee, Kai-Heng Feng, linux-wireless, netdev,
	linux-kernel, clang-built-linux

On Mon, Oct 26, 2020 at 10:22:55PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/net/wireless/realtek/rtw88/fw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
> index 042015bc8055..b2fd87834f23 100644
> --- a/drivers/net/wireless/realtek/rtw88/fw.c
> +++ b/drivers/net/wireless/realtek/rtw88/fw.c
> @@ -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;
>  	}
> -- 
> 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/20201011155438.15892-1-trix@redhat.com/

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

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH\ net] rtw88: fix fw dump support detection
  2020-10-26 21:22 [PATCH\ net] rtw88: fix fw dump support detection Arnd Bergmann
  2020-10-27  1:39 ` Nathan Chancellor
@ 2020-11-02 18:13 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2020-11-02 18:13 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Yan-Hsuan Chuang, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Nathan Chancellor, Nick Desaulniers, Tzu-En Huang, Ping-Ke Shih,
	Chin-Yen Lee, Kai-Heng Feng, linux-wireless, netdev,
	linux-kernel, clang-built-linux

Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

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

Patch set to Superseded.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20201026212323.3888550-1-arnd@kernel.org/

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-02 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 21:22 [PATCH\ net] rtw88: fix fw dump support detection Arnd Bergmann
2020-10-27  1:39 ` Nathan Chancellor
2020-11-02 18:13 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).