From patchwork Fri Mar 12 17:29:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 12135539 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0E51C433DB for ; Fri, 12 Mar 2021 17:30:21 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 68E0E64F0B for ; Fri, 12 Mar 2021 17:30:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68E0E64F0B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=bckEV8Y8GxSHWg996Ajlv06snsgpinJlLWq/m2OSnzg=; b=a4J9lHwKHdifU7OkSVGe1ftOsb 9iX37GjIWcxsQh1SpbHxTS/ySuvQ3JrCtbc0bWJapeA3PgOtMV8iwB81o9pPymehK+auDIwEMWxnl QsViTItMhHgkvttU0/ecf4Vu7JDJPFyVe4VdvzFopTGTYnjoOUYt0EjXf6ePDQlr8FmXyoAnTbuXt 6Pwd0KiYDj4lv63ZfODskUaVOjtvIab0K9sk9bdvPjY+ZCjNQSXYUXkUPgQwi3dB60a61Q72i9Lwm LvlyhwsGnsZW7d4FaaFyecvaUsN/CHLPukDAVyWU4Mt92dhk9mYa8I4CZC0nu9Q6uZTQhI6uZEtpj fDVAMiQA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKlc1-00C5oR-Vt; Fri, 12 Mar 2021 17:30:10 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKlbq-00C5mg-DL; Fri, 12 Mar 2021 17:30:00 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lKlbi-0001et-6K; Fri, 12 Mar 2021 17:29:50 +0000 From: Colin King To: Felix Fietkau , Lorenzo Bianconi , Kalle Valo , "David S . Miller" , Jakub Kicinski , Matthias Brugger , Sean Wang , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mt76: mt7921: remove redundant check on type Date: Fri, 12 Mar 2021 17:29:49 +0000 Message-Id: <20210312172949.153418-1-colin.king@canonical.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210312_172958_557936_612DB75D X-CRM114-Status: GOOD ( 10.16 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Colin Ian King Currently in the switch statement case where type is NL80211_IFTYPE_STATION there is a check to see if type is not NL80211_IFTYPE_STATION. This check is always false and is redundant dead code that can be removed. Addresses-Coverity: ("Logically dead code") Fixes: e0f9fdda81bd ("mt76: mt7921: add ieee80211_ops") Signed-off-by: Colin Ian King --- drivers/net/wireless/mediatek/mt76/mt7921/main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c index 729f6c42cdde..c8975f372cf2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -224,9 +224,6 @@ static int get_omac_idx(enum nl80211_iftype type, u64 mask) if (i) return i - 1; - if (type != NL80211_IFTYPE_STATION) - break; - /* next, try to find a free repeater entry for the sta */ i = get_free_idx(mask >> REPEATER_BSSID_START, 0, REPEATER_BSSID_MAX - REPEATER_BSSID_START);