* [PATCH] net: hip04: Omit private ndo_get_stats function
@ 2017-02-14 14:10 Tobias Klauser
2017-02-14 20:03 ` David Miller
2017-02-15 10:28 ` Joe Perches
0 siblings, 2 replies; 5+ messages in thread
From: Tobias Klauser @ 2017-02-14 14:10 UTC (permalink / raw)
To: netdev; +Cc: yisen.zhuang, salil.mehta
hip04_get_stats() just returns dev->stats so we can leave it
out altogether and let dev_get_stats() do the job.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
drivers/net/ethernet/hisilicon/hip04_eth.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index 6e50ec82b3d8..0cec06bec63e 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -701,11 +701,6 @@ static void hip04_tx_timeout_task(struct work_struct *work)
hip04_mac_open(priv->ndev);
}
-static struct net_device_stats *hip04_get_stats(struct net_device *ndev)
-{
- return &ndev->stats;
-}
-
static int hip04_get_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ec)
{
@@ -764,7 +759,6 @@ static const struct ethtool_ops hip04_ethtool_ops = {
static const struct net_device_ops hip04_netdev_ops = {
.ndo_open = hip04_mac_open,
.ndo_stop = hip04_mac_stop,
- .ndo_get_stats = hip04_get_stats,
.ndo_start_xmit = hip04_mac_start_xmit,
.ndo_set_mac_address = hip04_set_mac_address,
.ndo_tx_timeout = hip04_timeout,
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] net: hip04: Omit private ndo_get_stats function
2017-02-14 14:10 [PATCH] net: hip04: Omit private ndo_get_stats function Tobias Klauser
@ 2017-02-14 20:03 ` David Miller
2017-02-15 10:28 ` Joe Perches
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2017-02-14 20:03 UTC (permalink / raw)
To: tklauser; +Cc: netdev, yisen.zhuang, salil.mehta
From: Tobias Klauser <tklauser@distanz.ch>
Date: Tue, 14 Feb 2017 15:10:06 +0100
> hip04_get_stats() just returns dev->stats so we can leave it
> out altogether and let dev_get_stats() do the job.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Applied to net-next, thank you.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: hip04: Omit private ndo_get_stats function
2017-02-14 14:10 [PATCH] net: hip04: Omit private ndo_get_stats function Tobias Klauser
2017-02-14 20:03 ` David Miller
@ 2017-02-15 10:28 ` Joe Perches
2017-02-15 10:38 ` Tobias Klauser
1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2017-02-15 10:28 UTC (permalink / raw)
To: Tobias Klauser, netdev; +Cc: yisen.zhuang, salil.mehta
On Tue, 2017-02-14 at 15:10 +0100, Tobias Klauser wrote:
> hip04_get_stats() just returns dev->stats so we can leave it
> out altogether and let dev_get_stats() do the job.
This could be done for at least a few more drivers:
drivers/net/ethernet/chelsio/cxgb/sge.c
drivers/net/ethernet/intel/e1000/e1000_main.c
drivers/net/ethernet/intel/ixgb/ixgb_main.c
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: hip04: Omit private ndo_get_stats function
2017-02-15 10:28 ` Joe Perches
@ 2017-02-15 10:38 ` Tobias Klauser
2017-02-15 10:51 ` Joe Perches
0 siblings, 1 reply; 5+ messages in thread
From: Tobias Klauser @ 2017-02-15 10:38 UTC (permalink / raw)
To: Joe Perches; +Cc: netdev
On 2017-02-15 at 11:28:08 +0100, Joe Perches <joe@perches.com> wrote:
> On Tue, 2017-02-14 at 15:10 +0100, Tobias Klauser wrote:
> > hip04_get_stats() just returns dev->stats so we can leave it
> > out altogether and let dev_get_stats() do the job.
>
> This could be done for at least a few more drivers:
>
> drivers/net/ethernet/chelsio/cxgb/sge.c
I don't see an .ndo_get_stats being defined/set in this file. AFAICT,
this driver sets .ndo_get_stats to t1_get_stats(), which does some
additional extraction of statistics from device registers and thus
shouldn't be removed.
> drivers/net/ethernet/intel/e1000/e1000_main.c
> drivers/net/ethernet/intel/ixgb/ixgb_main.c
Will cover these in follow-up patches, thanks.
> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
A patch for pch_gbe already landed in net-next.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: hip04: Omit private ndo_get_stats function
2017-02-15 10:38 ` Tobias Klauser
@ 2017-02-15 10:51 ` Joe Perches
0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2017-02-15 10:51 UTC (permalink / raw)
To: Tobias Klauser; +Cc: netdev
On Wed, 2017-02-15 at 11:38 +0100, Tobias Klauser wrote:
> On 2017-02-15 at 11:28:08 +0100, Joe Perches <joe@perches.com> wrote:
> > On Tue, 2017-02-14 at 15:10 +0100, Tobias Klauser wrote:
> > > hip04_get_stats() just returns dev->stats so we can leave it
> > > out altogether and let dev_get_stats() do the job.
> >
> > This could be done for at least a few more drivers:
> >
> > drivers/net/ethernet/chelsio/cxgb/sge.c
>
> I don't see an .ndo_get_stats being defined/set in this file. AFAICT,
> this driver sets .ndo_get_stats to t1_get_stats(), which does some
> additional extraction of statistics from device registers and thus
> shouldn't be removed.
Right.
> > drivers/net/ethernet/intel/e1000/e1000_main.c
> > drivers/net/ethernet/intel/ixgb/ixgb_main.c
>
> Will cover these in follow-up patches, thanks.
Thanks.
> > drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
>
> A patch for pch_gbe already landed in net-next.
Great, cheers, Joe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-02-15 10:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-14 14:10 [PATCH] net: hip04: Omit private ndo_get_stats function Tobias Klauser
2017-02-14 20:03 ` David Miller
2017-02-15 10:28 ` Joe Perches
2017-02-15 10:38 ` Tobias Klauser
2017-02-15 10:51 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox