From patchwork Sun Feb 23 23:21:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thorsten Blum X-Patchwork-Id: 13987250 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C739C021B2 for ; Sun, 23 Feb 2025 23:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ZXsjCNy4V+kCyFuif8XWdLqtmoN0EswAxYS9Q53oLPQ=; b=kOb3oP9AMw6fAL0pP+dQTfxSKY 9g+YAls6HU2xeVCEAAzNXKyKYjXFnwrG0r2CFV30Qblo/D1ynO7aF6BVyVh85tA00KaaTOHiBkziV hMETl0eYbX5bTihbElhj8mFylrIwpWrUU7KITQpSRhaOgzmOpZa0QXY6zxVQSPhgJXBuoVJ3E89Rs id4ficj8dtXu2QoKV4tgbZ+Ca580oKFTNX6PTfQrM9xwMqdZz4NWTkVUq1/mHfck6t4zW3vfb/HRX 6xPDvxpUAH23GhRQNg1w1iMBqgFwl7QZ/o5oC/yjSRIdoHY5QEXT3L+tllwbNcjbhBFJ7ljE062hs ycBwWcFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tmLL4-0000000Bxpe-0wGR; Sun, 23 Feb 2025 23:24:46 +0000 Received: from out-186.mta1.migadu.com ([2001:41d0:203:375::ba]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tmLJa-0000000Bxje-13yb for linux-arm-kernel@lists.infradead.org; Sun, 23 Feb 2025 23:23:16 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1740352981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ZXsjCNy4V+kCyFuif8XWdLqtmoN0EswAxYS9Q53oLPQ=; b=NhM4NRdr+vfHRpfKDz22u8xvKhUui2K8mcLNioPcSxfF7v5JjqpR0/ERdZSgFG2uDTT5hD tlFGWAu1i1X8Kg/Nn60k4bs2QHbmmaVu1fd1IOdGJhAEHRmRBUM/aMHkqvwEjuh0E0DDKm DNuClbuZB9unk0HeYhqZroEoNVzxhdo= From: Thorsten Blum To: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Johannes Berg , Matthias Brugger , AngeloGioacchino Del Regno , Deren Wu , Ming Yen Hsieh , Quan Zhou Cc: Thorsten Blum , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH wireless-next] wifi: mt76: mt7925: Remove unnecessary if-check Date: Mon, 24 Feb 2025 00:21:24 +0100 Message-ID: <20250223232127.99357-2-thorsten.blum@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250223_152315_044559_E5372008 X-CRM114-Status: UNSURE ( 7.30 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The if and else branches implement the same logic. Remove the unnecessary if-check and simplify the code. Signed-off-by: Thorsten Blum --- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 15815ad84713..7e4935965d35 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1983,11 +1983,7 @@ int mt7925_mcu_sta_update(struct mt792x_dev *dev, mlink = mt792x_sta_to_link(msta, link_sta->link_id); } info.wcid = link_sta ? &mlink->wcid : &mvif->sta.deflink.wcid; - - if (link_sta) - info.newly = state != MT76_STA_INFO_STATE_ASSOC; - else - info.newly = state == MT76_STA_INFO_STATE_ASSOC ? false : true; + info.newly = state != MT76_STA_INFO_STATE_ASSOC; if (ieee80211_vif_is_mld(vif)) err = mt7925_mcu_mlo_sta_cmd(&dev->mphy, &info);