From patchwork Sun Oct 7 09:37:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10629443 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 7EA3E933 for ; Sun, 7 Oct 2018 09:38:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DCB628623 for ; Sun, 7 Oct 2018 09:38:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FAC428646; Sun, 7 Oct 2018 09:38:08 +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 B1D3328623 for ; Sun, 7 Oct 2018 09:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726442AbeJGQog (ORCPT ); Sun, 7 Oct 2018 12:44:36 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41324 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726152AbeJGQof (ORCPT ); Sun, 7 Oct 2018 12:44:35 -0400 Received: by mail-wr1-f66.google.com with SMTP id x12-v6so17605200wru.8 for ; Sun, 07 Oct 2018 02:37:53 -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:mime-version :content-transfer-encoding; bh=extZaW2yg1COH176bQUirSM9XC1htSnlUUvRMTMDth0=; b=qQ1KAFlsVQNQ5hg7Puwsk3pXzgKAhrq5rPvSZq02PfASZACmzkWst6kKyP3aaZiije HlkM8IfjYF1gFFI1G5e/lEuQEITrrQvt7AfjqmNfI8yGMXzW8uK9dztQ8x5fb17683iI C6XGZ5RqtLd8DRxKhUJs7P65sq2s7cfctHkYTDN7LIH4i3hUCWRMwphExAk514RqWOrg qB31J2eKwVBRkWDgIgOFv1D68NfDr6/Z2Y5m1jkZ25PwbDHYGYH6boL17UHp4DAWG6+x 5YoMMOmrEe29WSPBonH8N/36X0KoEgV39CKJaHKSuTclZNKGmeydyh6EsGWSYgXUGgXw 3NhA== X-Gm-Message-State: ABuFfohUjKmuzYFwAWJeOpRDUXOQiNpfqhralYitR+M2g+NsstDFyiyf gtu0eFG0O50VZdIdESEWQvax4A== X-Google-Smtp-Source: ACcGV60cO1oTjtg/m7M967EmVefz6pAhgLD1kSlpPOc7my2cEyYZQFLuyyIRQ84XC70+lTPTt+cPNg== X-Received: by 2002:a5d:40cd:: with SMTP id b13-v6mr13990887wrq.133.1538905072260; Sun, 07 Oct 2018 02:37:52 -0700 (PDT) Received: from localhost.localdomain ([151.66.32.138]) by smtp.gmail.com with ESMTPSA id v14-v6sm3687724wrw.28.2018.10.07.02.37.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Oct 2018 02:37:51 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: sgruszka@redhat.com, linux-wireless@vger.kernel.org Subject: [PATCH] mt76x0: phy: fix bank check in mt76x0_rf_csr_{wr,rr} Date: Sun, 7 Oct 2018 11:37:40 +0200 Message-Id: <20181007093740.11994-1-lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 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 typo in bank check in mt76x0_rf_csr_{wr,rr} routines. This issue has never been hit since mt76x0_rf_csr_{wr,rr} are actually used just by pci code Fixes: 10de7a8b4ab9 ("mt76x0: phy files") Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c index e2b62ce2306b..4419c0078a6f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c @@ -37,7 +37,7 @@ mt76x0_rf_csr_wr(struct mt76x02_dev *dev, u32 offset, u8 value) bank = MT_RF_BANK(offset); reg = MT_RF_REG(offset); - if (WARN_ON_ONCE(reg > 127) || WARN_ON_ONCE(bank) > 8) + if (WARN_ON_ONCE(reg > 127) || WARN_ON_ONCE(bank > 8)) return -EINVAL; mutex_lock(&dev->phy_mutex); @@ -76,7 +76,7 @@ static int mt76x0_rf_csr_rr(struct mt76x02_dev *dev, u32 offset) bank = MT_RF_BANK(offset); reg = MT_RF_REG(offset); - if (WARN_ON_ONCE(reg > 127) || WARN_ON_ONCE(bank) > 8) + if (WARN_ON_ONCE(reg > 127) || WARN_ON_ONCE(bank > 8)) return -EINVAL; mutex_lock(&dev->phy_mutex);