Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3478259pxu; Sun, 11 Oct 2020 11:07:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1zOu5SKBbgb/2U5Ak5e4fNBcOvlgCdaliD4S2ngJwg41+XJOL+yoQBNDRsTW8iRH4RJHd X-Received: by 2002:a05:6402:1a56:: with SMTP id bf22mr10304539edb.216.1602439656509; Sun, 11 Oct 2020 11:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602439656; cv=none; d=google.com; s=arc-20160816; b=ZtH4c4fikYWnefAih7OOC9jbQUC5FSb/IB1LnFGogBBwd+zlFM+Zrm+FRmvyYeUd8h SnitTIs5mx11LIi+uB/Z3jsm5yqyUGoHnKgSDqptXjUOxkCog/qf3cC4MOXdnjNuHq1g /T9THne9lOLanF1+Loi5+T6fe1Y2fteYb8nHoZG4iSzvIeRgFuo65MR5xb5Ygj/LVEPc fCxqDgNyNiJ/cgeTXuc8OwnIx7kxSPna7OzJKCNzAMNZUfe0EO0NcJgXmthAHOJWvC3I Jlt1Mtiro5qEFUUEwMpoJzasi53ESW/bJIeLBZ8B0tXa/GAJUxsXCxAoy5lVUFqhrV0C A77Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=pR1M69yxrP9JSOS0Ie5ezAaQo49msGZptm8kNeSlSi4=; b=gw/iB/riqP/EGoAX1K93cxNSfbvbW7FmoSZ7rlZY93NzwCzHWxhD2hey8RoOo/n5b8 JmNVwGCjragJKCSOMi5btVEfIi7jGTBprBXPGqqFOxoQBukLf2GiDR1eZBiVYkJpgwqj OxbiiR3DIj0bCrby9zw8FVnY3tjFC0ysE0ip4Uu4tCKONT+65ObOmC+mR3my+9bNnvxJ 8U57NFb8d/xiUFLQ8WD5ZubG9d4ivtPgMMD39tjRhKyCfJarkSM9T35ORZFib014kYgN YafV0S/NRgYUQTbmot8o0LLoi5bpwAP7i8Z+bKkRuouiJd/r+XwIdKm03hMQCLgV3+eU sZ7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="RnA8Q/+W"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m25si10684162ejb.269.2020.10.11.11.07.11; Sun, 11 Oct 2020 11:07:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="RnA8Q/+W"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730223AbgJKPzO (ORCPT + 99 others); Sun, 11 Oct 2020 11:55:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33479 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730138AbgJKPyr (ORCPT ); Sun, 11 Oct 2020 11:54:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602431686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=pR1M69yxrP9JSOS0Ie5ezAaQo49msGZptm8kNeSlSi4=; b=RnA8Q/+Wp2v9p6Ns6o4gZ+upo/MszJ1ShQDpQK5jFKPyD9YvqAiC+WqQWg9F9n91yq1kIm FNeQU+aDeVSlDMWmVMSKDXZ58Jnk9uKtzj2ze4NUzoMn5ZxETB9iU0kKGcS4mziBhnRADp 3Vz5PZ976w6POx5rdDUmVvzPCmkI8RE= Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-533-8awCT1e3NZynJXEI-oyF5g-1; Sun, 11 Oct 2020 11:54:44 -0400 X-MC-Unique: 8awCT1e3NZynJXEI-oyF5g-1 Received: by mail-oo1-f72.google.com with SMTP id s9so4590945oom.15 for ; Sun, 11 Oct 2020 08:54:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=pR1M69yxrP9JSOS0Ie5ezAaQo49msGZptm8kNeSlSi4=; b=YcsT9mJxTXb9Mu0+IcJvHM4RRKXtxLT5xiQmc39p/qqwbY8XdPS+tvYhadWT+M/1bZ TY3yORIAN6PXm+jSiuHrUfBjBoe1t4m3ffQcbtW1FyHau7s2IShjjJPVfLCB4jlZTsYL 56LhbZbwBLFbR6a4PuJkKmsQLkYP9FUOWxB4gr53xrtYHnmBjiCH+66Um36fKAzq8+tt 6BkNkZ3aY6hOC/vTHShw2P3+1NNrMYOG/CKsO5NzgG9p7CPsttP19d/LbTsC8iRc9KHm /XimBwfp5LhV0L2J0vzvJZJisYFRN9cswQnm5Qa2+wlB7ayDjKqYJZZptSLnSsu3FogA M6vA== X-Gm-Message-State: AOAM533ceF/Hw8+OqiGyAFA8ib9ZjxF5D+4pkiyZjpb2owoQsdXYoCfj F7RpNAUoWdt9r3DW5joR+s8o/mOhBE05L6PINLPpKciwIBQ390s99E24jNJSBpqNVqA1PhQFFCP 7fVoluLTmGSwDRzIjXgSzEGTSga8= X-Received: by 2002:a4a:da53:: with SMTP id f19mr15863004oou.38.1602431684163; Sun, 11 Oct 2020 08:54:44 -0700 (PDT) X-Received: by 2002:a4a:da53:: with SMTP id f19mr15862992oou.38.1602431683974; Sun, 11 Oct 2020 08:54:43 -0700 (PDT) Received: from trix.remote.csb (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id t22sm7969499otk.24.2020.10.11.08.54.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 08:54:43 -0700 (PDT) From: trix@redhat.com To: yhchuang@realtek.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, natechancellor@gmail.com, ndesaulniers@google.com Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Tom Rix Subject: [PATCH] rtw88: fix fw_fifo_addr check Date: Sun, 11 Oct 2020 08:54:38 -0700 Message-Id: <20201011155438.15892-1-trix@redhat.com> X-Mailer: git-send-email 2.18.1 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Tom Rix The clang build reports this warning fw.c:1485:21: warning: address of array 'rtwdev->chip->fw_fifo_addr' will always evaluate to 'true' if (!rtwdev->chip->fw_fifo_addr) { fw_fifo_addr is an array in rtw_chip_info so it is always nonzero. A better check is if the first element of the array is nonzero. In the cases where fw_fifo_addr is initialized by rtw88b and rtw88c, the first array element is 0x780. Signed-off-by: Tom Rix --- 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.18.1