Re: [PATCH net-next v2 07/12] net: stmmac: Add ethtool register dump for XGMAC cores

From: Jakub Kicinski
Date: Tue Aug 13 2019 - 17:19:31 EST


On Mon, 12 Aug 2019 11:44:06 +0200, Jose Abreu wrote:
> static void stmmac_ethtool_gregs(struct net_device *dev,
> struct ethtool_regs *regs, void *space)
> {
> - u32 *reg_space = (u32 *) space;
> -
> struct stmmac_priv *priv = netdev_priv(dev);
> + int size = stmmac_ethtool_get_regs_len(dev);
> + u32 *reg_space = (u32 *) space;
>
> - memset(reg_space, 0x0, REG_SPACE_SIZE);
> + memset(reg_space, 0x0, size);

no need to zero regs, ethtool core zallocs them