Netdev List
 help / color / mirror / Atom feed
From: Daniel Pawlik <pawlik.dan@gmail.com>
To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk
Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, kabel@kernel.org,
	petr.wozniak@gmail.com, maxime.chevallier@bootlin.com,
	olek2@wp.pl, Daniel Pawlik <pawlik.dan@gmail.com>
Subject: [PATCH net-next v3 1/2] net: sfp: move sfp_strlen() above the quirk fixups
Date: Fri, 20 Nov 2026 07:37:55 +0100	[thread overview]
Message-ID: <20261120063756.3677554-2-pawlik.dan@gmail.com> (raw)
In-Reply-To: <20261120063756.3677554-1-pawlik.dan@gmail.com>

sfp_strlen() is defined after the quirk table, so the fixups that the
table references cannot use it. Move it above the fixups so that the
next patch can match a vendor revision with the same space and NUL
padding rules as the vendor name and part number matching.

No functional change.

Signed-off-by: Daniel Pawlik <pawlik.dan@gmail.com>
---
 drivers/net/phy/sfp.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 915156743701..8406ad8ee786 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -482,6 +482,20 @@ static void sfp_fixup_rollball_cc(struct sfp *sfp)
 	sfp->id.base.extended_cc = SFF8024_ECC_10GBASE_T_SFI;
 }
 
+static size_t sfp_strlen(const char *str, size_t maxlen)
+{
+	size_t size, i;
+
+	/* Trailing characters should be filled with space chars, but
+	 * some manufacturers can't read SFF-8472 and use NUL.
+	 */
+	for (i = 0, size = 0; i < maxlen; i++)
+		if (str[i] != ' ' && str[i] != '\0')
+			size = i + 1;
+
+	return size;
+}
+
 static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id,
 				struct sfp_module_caps *caps)
 {
@@ -660,20 +674,6 @@ static const struct sfp_quirk sfp_quirks[] = {
 	SFP_QUIRK_S("ZOERAX", "SFP-2.5G-T", sfp_quirk_oem_2_5g),
 };
 
-static size_t sfp_strlen(const char *str, size_t maxlen)
-{
-	size_t size, i;
-
-	/* Trailing characters should be filled with space chars, but
-	 * some manufacturers can't read SFF-8472 and use NUL.
-	 */
-	for (i = 0, size = 0; i < maxlen; i++)
-		if (str[i] != ' ' && str[i] != '\0')
-			size = i + 1;
-
-	return size;
-}
-
 static bool sfp_match(const char *qs, const char *str, size_t len, bool prefix)
 {
 	size_t qs_len;
-- 
2.56.1


  reply	other threads:[~2026-11-20  6:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  6:37 [PATCH net-next v3 0/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T Daniel Pawlik
2026-11-20  6:37 ` Daniel Pawlik [this message]
2026-11-20  6:37 ` [PATCH net-next v3 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B Daniel Pawlik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120063756.3677554-2-pawlik.dan@gmail.com \
    --to=pawlik.dan@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=olek2@wp.pl \
    --cc=pabeni@redhat.com \
    --cc=petr.wozniak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox