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 --- 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