From patchwork Tue Oct 15 11:09:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 13836194 X-Patchwork-Delegate: kuba@kernel.org Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E76B51E32AF; Tue, 15 Oct 2024 11:09:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.4.11.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728990595; cv=none; b=gzrPbViXOEXxdf76RKpsnWXlDerkSqgswVczWVGxXCoaRk3Jl1nxX9PCx9ZOPH+XG0z3FGVUiBWalIhUthTcu7uQZfMhOThnHbwWysuQzCJ4jk0rqr5M5rjoBeAI9Tf33Xz73ke9N4VpAzEy4qr4AFo6mGVABBGvgA6F4htqKvE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728990595; c=relaxed/simple; bh=u/ZF658jnh35jb/jImoWHb8+tweptTkbxHIN0BLRg/Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=o6uKuf+hLkY4pRwux6KAas/Cr6c4lSdorwE7UjqpS6t0f4G75x8OE4riHrBnxA5xyfcVtyowL3MMgKfuKD0R6HR6tJuzHoZTcOGVZFPCdhON/FRzl6iq5XfHaYE+b+wOwKlfKrwi4wmWgZ3spcWzbPr/7uPXC0SN4sJtPKRWUl8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name; spf=none smtp.mailfrom=nbd.name; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b=murZkFD/; arc=none smtp.client-ip=46.4.11.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=nbd.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="murZkFD/" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender: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-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=00J3RVPq4/h4Gn9zjAJgxg9MqOXs2BDYFaepZNulNug=; b=murZkFD/6e9FjDuEIp5PZR/1bR LzkxMjmNagb5GYM9dLk9SPNm82n01g+KRK4q1pS/kxvZtPVk6yOcwEi11P8OhLOpqvt7eINvvQITQ k3/q7lK4AqPOn78czVrT/yEXLrfQZPESdR/piJAnS3FouSWuV2BccVYUtUouh8Cz5leM=; Received: from p54ae9bfc.dip0.t-ipconnect.de ([84.174.155.252] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.96) (envelope-from ) id 1t0fQr-0096bC-0o; Tue, 15 Oct 2024 13:09:41 +0200 From: Felix Fietkau To: netdev@vger.kernel.org, Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next 1/4] net: ethernet: mtk_eth_soc: compile out netsys v2+ code on mt7621 Date: Tue, 15 Oct 2024 13:09:35 +0200 Message-ID: <20241015110940.63702-1-nbd@nbd.name> X-Mailer: git-send-email 2.47.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Avoid some branches in the hot path on low-end devices with limited CPU power, and reduce code size Signed-off-by: Felix Fietkau --- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h index 0d5225f1d3ee..654897141869 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -1324,16 +1324,22 @@ extern const struct of_device_id of_mtk_match[]; static inline bool mtk_is_netsys_v1(struct mtk_eth *eth) { + if (IS_ENABLED(CONFIG_SOC_MT7621)) + return true; return eth->soc->version == 1; } static inline bool mtk_is_netsys_v2_or_greater(struct mtk_eth *eth) { + if (IS_ENABLED(CONFIG_SOC_MT7621)) + return false; return eth->soc->version > 1; } static inline bool mtk_is_netsys_v3_or_greater(struct mtk_eth *eth) { + if (IS_ENABLED(CONFIG_SOC_MT7621)) + return false; return eth->soc->version > 2; }