From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 87003A41 for ; Wed, 29 Oct 2025 00:01:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761696096; cv=none; b=CzKGHvYeMRzCUpm60CF39Bwrl2MPvmQqI/DOU0+bjHmQTjVVi2K/DPQHo27lK2SokqWzz2gN7baryFKbDuZzvQEIz7TlvCcz3RBsp0qQjs4uAMOz1P8SYVwJ2Hr30/mamuIyINrtmTXAFy8DM3u0rVZVcbm89gpVdYV8O/7bRVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761696096; c=relaxed/simple; bh=8mVwAQHQcMN7XIIFIbLD9IFQQThwuKYQQA3VP/7U9CI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=FNRCdqwkEEK6/nzLWs5jBtjiZCK0Iut8yeR0klJSM5gKJlbUDCAA8mEJ8EaC2mj3yKcugK7JiGZ/0fqjYhBvDQxZ8WWbYDhnsLvxqEL5X0Izp7SUgXURUXXPsH2mmis/e5xZtXi6/EkTHT5/ULkYPDpUFQoTXxwuIoxnGJFkbIo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=Vyad4FrE; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="Vyad4FrE" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: 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=M3WA5E7+cy9RohdVFrjxmxJVZbOtCukuTF1uMkF0/0U=; b=Vyad4FrEExaL7FkATlCAhSO1Tm SdG0BZo7VdEY0Tt0bvik1+wXq6izLDz10l+Gh+ibkFdT8pEvvIKdv8+c2EKZzQPeDfoMEJmLdtiKs 1ur4x7fRCKhId0rUbGKvX8yagFrABdz+Hgq+0FZqZmJfoLvl+0pOPYWjBr3sKRQ9UXzuubm+tu9qx W+FCY9OYF1q35EXP6+Yw2J79AGCTMRp+jZACw6YqmUp5OdH4X2JiWOoslYCNemsQYJuoYTVdSoii/ p/ZF+W8K8jFqMNmboMn8+4bRnyJdzcBdtP3AUxgG+hg2/XRvca6W8kk929WjWlMt7SW6irJE4r5pV peELBMCA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:57384) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vDtd1-000000003g6-34U2; Wed, 29 Oct 2025 00:01:27 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vDtcz-000000006yS-2jNj; Wed, 29 Oct 2025 00:01:25 +0000 Date: Wed, 29 Oct 2025 00:01:25 +0000 From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni , Richard Cochran Subject: [PATCH net-next v3 0/8] net: stmmac: hwif.c cleanups Message-ID: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: Russell King (Oracle) Hi, This series cleans up hwif.c: - move the reading of the version information out of stmmac_hwif_init() into its own function, stmmac_get_version(), storing the result in a new struct. - simplify stmmac_get_version(). - read the version register once, passing it to stmmac_get_id() and stmmac_get_dev_id(). - move stmmac_get_id() and stmmac_get_dev_id() into stmmac_get_version() - define version register fields and use FIELD_GET() to decode - start tackling the big loop in stmmac_hwif_init() - provide a function, stmmac_hwif_find(), which looks up the hwif entry, thus making a much smaller loop, which improves readability of this code. - change the use of '^' to '!=' when comparing the dev_id, which is what is really meant here. - reorganise the test after calling stmmac_hwif_init() so that we handle the error case in the indented code, and the success case with no indent, which is the classical arrangement. --- v3: - fix conflict with PCS IRQ changes v2: - fix "verison" typo, impacting patches 2, 3, and 4. - added reviewed-by / tested-bys drivers/net/ethernet/stmicro/stmmac/common.h | 3 + drivers/net/ethernet/stmicro/stmmac/hwif.c | 166 +++++++++++++++------------ 2 files changed, 98 insertions(+), 71 deletions(-) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!