dpaa2-eth: Fix minor bug in ethtool stats reporting
authorIoana Radulescu <ruxandra.radulescu@nxp.com>
Mon, 7 Oct 2019 11:38:27 +0000 (14:38 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Oct 2019 14:08:09 +0000 (10:08 -0400)
Don't print error message for a successful return value.

Fixes: d84c3a4ded96 ("dpaa2-eth: Add new DPNI statistics counters")
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c

index 0aa1c34019bbe8566d7baf71f720b67a378dc05e..dc9a6c36cac027ab015b8e6fdcf118ef325f37ce 100644 (file)
@@ -216,7 +216,7 @@ static void dpaa2_eth_get_ethtool_stats(struct net_device *net_dev,
                if (err == -EINVAL)
                        /* Older firmware versions don't support all pages */
                        memset(&dpni_stats, 0, sizeof(dpni_stats));
-               else
+               else if (err)
                        netdev_warn(net_dev, "dpni_get_stats(%d) failed\n", j);
 
                num_cnt = dpni_stats_page_size[j] / sizeof(u64);