lkml.org 
[lkml]   [2020]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] net: sfp: allow to use also SFP modules which are detected as SFF
On Wed, Dec 30, 2020 at 06:27:07PM +0100, Marek Behún wrote:
> On Wed, 30 Dec 2020 18:06:52 +0100
> Pali Rohár <pali@kernel.org> wrote:
>
> > if (!sfp->type->module_supported(&id) &&
> > (memcmp(id.base.vendor_name, "UBNT ", 16) ||
> > memcmp(id.base.vendor_pn, "UF-INSTANT ", 16)))
>
> I would rather add a quirk member (bitfield) to the sfp structure and do
> something like this
>
> if (!sfp->type->module_supported(&id) &&
> !(sfp->quirks & SFP_QUIRK_BAD_PHYS_ID))
>
> or maybe put this check into the module_supported method.

Sorry, definitely not. If you've ever looked at the SDHCI driver with
its multiple "quirks" bitfields, doing this is a recipe for creating
a very horrid hard to understand mess.

What you suggest just results in yet more complexity.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

\
 
 \ /
  Last update: 2020-12-30 20:16    [W:0.074 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site