lkml.org 
[lkml]   [2021]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [net-next] net: mvpp2: Add reserved port private flag configuration
>  static void mvpp2_ethtool_get_strings(struct net_device *netdev, u32 sset,
> u8 *data)
> {
> struct mvpp2_port *port = netdev_priv(netdev);
> int i, q;
>
> - if (sset != ETH_SS_STATS)
> - return;
> + switch (sset) {
> + case ETH_SS_STATS:
> + for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_mib_regs); i++) {
> + strscpy(data, mvpp2_ethtool_mib_regs[i].string,
> + ETH_GSTRING_LEN);
> + data += ETH_GSTRING_LEN;
> + }

Hi Stefan

Maybe rename the existing function to
mvpp2_ethtool_get_strings_stats() and turn it into a helper. Add a new
mvpp2_ethtool_get_strings_priv() helper. And a new
mvpp2_ethtool_get_strings() which just calls the two helpers. Overall
the patch should be smaller and much easier to review.

Andrew

\
 
 \ /
  Last update: 2021-03-10 16:51    [W:0.054 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site