Re: [PATCH net-next v3 2/7] net: Add helpers for netdev LEDs

Andrew Lunn
2024-04-03T23:43:48Z

> Should we be even more opaque in the API, aka instead of requiring the
> user to explicitly hold a struct list_head, just give it an opaque
> struct netdev_led_group * which holds that (as a hidden implementation
> detail)?
>
> The API structure could be simply styled as
> "struct netdev_led_group *netdev_led_group_create()" and
> "void netdev_led_group_destroy(const struct netdev_led_group *group)",
> and it would allow for future editing of the actual implementation.
>
> Just an idea.

Hi Vladimir

I'm not sure making it opaque brings much for this case. It is so
simple. Things like phylink should be opaque, there is a lot of
internal state which if used in a MAC driver is going to cause all
sorts of problem, and is likely to be used wrong. But here?

So i will probably leave this transparent.

Thanks for the other comments. I'm slowly working on them as time
permits.

Andrew