From nobody Mon Feb 9 14:32:35 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 0A45132548E for ; Tue, 3 Feb 2026 17:29:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770139744; cv=none; b=cZrJxVhCyxZogvrOI+Bgu7Z+oRs7/EaIuQj7MB2LA4J5/C2yUSS15Oa4I3gRI+jQWDnBdWPX2Hic+vgwyAAyAU1qailcbPZ59Gi+eX0gShO+xLmxe0zEMD6yAO9Dgf8P7tUUQYuan+z/OBVhs1YKq5vlO6gUGHVE/dvqbrHH/PY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770139744; c=relaxed/simple; bh=mWyMx4Wb/HCw51vDYbHGsY4S6C9v30+HtBdi1q1SCSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Sa9F41irhjodFU/M27/RZmNtMjgNWI8RwVK7sXvn1+UqF/QgPeosLLNEWzBIrmVM/VFjWWbPRormsJtaE28xKSxbmcnwvkEB/SWvuADsFOPbxNkK2a43GBJ9fEaRrs83e6iloOlF89C5lXCPkzEvnu7PNV1A0de2hx0P/LXAygY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=0oL+5ezK; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="0oL+5ezK" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 5345EC24386; Tue, 3 Feb 2026 17:29:01 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 10D3160728; Tue, 3 Feb 2026 17:28:56 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A7D8A119A8891; Tue, 3 Feb 2026 18:28:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1770139734; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=KecJRPe2Bv70TIJpdknGkVxhofD7qopvizBIlkrUTDs=; b=0oL+5ezK79vBEpfRX9ZMmL99O5b7ITFB+focEqMtyIuOjKO0HftypZfxC+GmiV3wGeyUi+ cNq6JDVr+wFjGMmGwl2pyzaWGOuUED8TuwlsBkrseEX4/I42tfPlMcqFUy2X2I6q07HGUN ZqunLmyZVgbRNhv17NHnaOXAeR8jHrRzOalZJEJEG6mLwbqo3BJ/JlVu9i00dq1XqjLsUK KS4cE2lX+VAc/prdbkzM1huEoO0bbnzzCCxDoZ4TFJ8EIIyPYtiD7omwqPKT2Tm+KtkLWZ EcVQou92bUb9DOvavoBfUp56qddqW/7RGq90K/MMiRGAN6XN14R4sGtfsogORg== From: Maxime Chevallier To: davem@davemloft.net, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , Heiner Kallweit Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Christophe Leroy , Herve Codina , Florian Fainelli , Vladimir Oltean , =?UTF-8?q?K=C3=B6ry=20Maincent?= , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Oleksij Rempel , =?UTF-8?q?Nicol=C3=B2=20Veronese?= , Simon Horman , mwojtas@chromium.org, Romain Gantois , Daniel Golle , Dimitri Fedrau Subject: [PATCH net-next v4 02/13] net: phy: phy_port: Cleanup the of-parsing logic for phy_port Date: Tue, 3 Feb 2026 18:28:26 +0100 Message-ID: <20260203172839.548524-3-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260203172839.548524-1-maxime.chevallier@bootlin.com> References: <20260203172839.548524-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" We don't need to maintain a mediums bitfield, let's drop it and drop a bogus check for empty mediums, as we already check it above. Signed-off-by: Maxime Chevallier --- drivers/net/phy/phy_port.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/phy_port.c b/drivers/net/phy/phy_port.c index ec93c8ca051e..a269e9ea12c4 100644 --- a/drivers/net/phy/phy_port.c +++ b/drivers/net/phy/phy_port.c @@ -53,7 +53,7 @@ struct phy_port *phy_of_parse_port(struct device_node *dn) enum ethtool_link_medium medium; struct phy_port *port; const char *med_str; - u32 pairs =3D 0, mediums =3D 0; + u32 pairs =3D 0; int ret; =20 ret =3D fwnode_property_read_string(fwnode, "media", &med_str); @@ -85,17 +85,12 @@ struct phy_port *phy_of_parse_port(struct device_node *= dn) return ERR_PTR(-EINVAL); } =20 - mediums |=3D BIT(medium); - - if (!mediums) - return ERR_PTR(-EINVAL); - port =3D phy_port_alloc(); if (!port) return ERR_PTR(-ENOMEM); =20 port->pairs =3D pairs; - port->mediums =3D mediums; + port->mediums =3D BIT(medium); =20 return port; } --=20 2.49.0