From patchwork Mon Oct 26 21:22:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11858807 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 286B21130 for ; Mon, 26 Oct 2020 21:23:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 09E572084C for ; Mon, 26 Oct 2020 21:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603747417; bh=1cdNvddUdNByOuemIzD0FWBYLNf7FJXR1LgisTFtu5c=; h=From:To:Cc:Subject:Date:List-ID:From; b=GMB5kBRLkH6exvFkHJ5WzD4F1L1kNG/boG479C+1qCeQpJp4HDFCATkNp0uaC7IAl 2gLkv0oSrF/TEAzF7JG0LWx6fY7ef8xC91BPLnG9b9NAsHeElPG/XHApgxDvqZiguR NCtQ2dE11DG1eQoCHGRQb7FrcAl1lXM4n/2SuqQE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731606AbgJZVXb (ORCPT ); Mon, 26 Oct 2020 17:23:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:39588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731589AbgJZVXb (ORCPT ); Mon, 26 Oct 2020 17:23:31 -0400 Received: from localhost.localdomain (unknown [192.30.34.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1046D207F7; Mon, 26 Oct 2020 21:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603747410; bh=1cdNvddUdNByOuemIzD0FWBYLNf7FJXR1LgisTFtu5c=; h=From:To:Cc:Subject:Date:From; b=fAmEUO8nuXZRXASZgXCPeG5+iN//fc3aROoRzkMVOZkDIAONM1oZaat9MyBjNX9N4 TllIkCzBqn+TFbd+aQ+zxHjZUquYwSfMZwgmCYH/fosS/dWSYbORZFpbmbOR/NP0UG zrEIordMT+Ufgx5Mbkb8lLXaH4BvECr3PKN14YW4= From: Arnd Bergmann 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@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH\ net] rtw88: fix fw dump support detection Date: Mon, 26 Oct 2020 22:22:55 +0100 Message-Id: <20201026212323.3888550-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Arnd Bergmann 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 Reviewed-by: Nathan Chancellor --- 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; }