lkml.org 
[lkml]   [2019]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC PATCH net-next v3 14/21] ethtool: provide link mode names as a string set
    From
    Date


    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

    \
     
     \ /
      Last update: 2019-02-21 04:22    [W:3.440 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site