Messages in this thread | | | Subject | Re: [RFC PATCH net-next v3 14/21] ethtool: provide link mode names as a string set | From | Florian Fainelli <> | Date | Wed, 20 Feb 2019 19:21:58 -0800 |
| |
On 2/18/2019 10:22 AM, Michal Kubecek wrote: > Add table of ethernet link mode names and make it available as a string set > to userspace GET_STRSET requests. > > Signed-off-by: Michal Kubecek <mkubecek@suse.cz> > ---
[snip]
> > +const char *const link_mode_names[] = {
Maybe you can define a macro (totally untested) to build the table an avoid some of the repetition, something like:
#define ETHTOOL_LINK_NAME(speed, duplex) \ [ETHTOOL_LINK_MODE_##speed_##duplex_BIT] = stringify(speed ## "/" ## duplex)
-- Florian
| |