From patchwork Mon Aug 20 16:50:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10570555 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 067AE5A4 for ; Mon, 20 Aug 2018 16:50:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7732295D4 for ; Mon, 20 Aug 2018 16:50:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D992329661; Mon, 20 Aug 2018 16:50:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BC07295D4 for ; Mon, 20 Aug 2018 16:50:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726883AbeHTUHI (ORCPT ); Mon, 20 Aug 2018 16:07:08 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41994 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbeHTUHI (ORCPT ); Mon, 20 Aug 2018 16:07:08 -0400 Received: by mail-wr1-f68.google.com with SMTP id e7-v6so13533922wrs.9 for ; Mon, 20 Aug 2018 09:50:43 -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:in-reply-to :references; bh=5SIzk0J9ycPKzuTSd613c7CG/qojU4cn7sS9GPOzfQc=; b=pUsED5d6EcMzTl4M1Ma8nRAldlH/D6xVMY3qUHndkl5iLT10B8vaFoABfMIsggg+S4 ulptO5r20xcbjmSSVPjjGMHwv+72RnJuKjm4TOZsjRg63HNQZNNWVnpf0ngXAv/5knUi hblq2zl1loBwqw6JKX4AgncoIAS76WcLnnTe42slSvNmMFc7gyx73vRt2wsLpPXWlYv0 MCat8qRPSAG7vO6xvhVC27BGB3qQArbKLfn2ArLn8cPnh+wri5CODQn/G33FJwQ4JtGj fP0IyzlHDLaehzAMTGP83hznc54GBTPW39iILKZudRF01iwOf2uEGo+krU4/fzgKlUjn Hzhw== X-Gm-Message-State: AOUpUlGOW0MFtWxzQkMG+0ncP2i87g+8EvDqorG+pePWjP8f8foQZWtt NYL3YC7ggZJGzeCFxcIj4SgaUg== X-Google-Smtp-Source: AA+uWPwkR7DDy0CGi71M6DRMlrTxL/wOMES/E+RJc4tdrMG5CnuCPrscQMnvWjJUVWowzh/tai0/hw== X-Received: by 2002:adf:cd82:: with SMTP id q2-v6mr31198074wrj.118.1534783843187; Mon, 20 Aug 2018 09:50:43 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id q21-v6sm10127124wmq.3.2018.08.20.09.50.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Aug 2018 09:50:42 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, dan.carpenter@oracle.com Subject: [PATCH] mt76x2: fix always true condition warning reported by static checker Date: Mon, 20 Aug 2018 18:50:19 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix following warning reported by static checker: drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c:35 mt76x2_tx() warn: always true condition '(wcid->hw_key_idx != -1) => (0-255 != (-1))' Fixes: 23405236460b ("mt76: fix transmission of encrypted mgmt frames") Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c b/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c index 36afb166fa3f..c0ca0df84ed8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c @@ -32,7 +32,7 @@ void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, msta = (struct mt76x2_sta *)control->sta->drv_priv; wcid = &msta->wcid; /* sw encrypted frames */ - if (!info->control.hw_key && wcid->hw_key_idx != -1) + if (!info->control.hw_key && wcid->hw_key_idx != 0xff) control->sta = NULL; }