• T
    cmd: mii: Refactor some of the MII reg dump code · 4ef3231b
    Trent Piepho 提交于
    Share the code that prints out a register field with the function that
    prints out the "special" fields.
    
    There were two arrays the register dump list, one with reg number and
    name, another with a pointer to the field table and the table size.
    These two arrays had have each entry match what register is referred to.
    Combine them into just one table.  Now they can't not match and there is
    just one table.
    
    Add some missing consts to pointers to string literals.
    
    The dump code was ignoring the regno field in the description table and
    assuming register 0 was at index 0, etc.  Have it use the field.
    
    Change reg > max+1 into reg >= max, which doesn't fail if max+1 could
    overflow, besides just making more sense.
    Signed-off-by: NTrent Piepho <tpiepho@impinj.com>
    Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
    4ef3231b
mii.c 12.1 KB