Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1555165 > unrolled thread

[PATCH] net: netcp: correct netcp_get_stats function signature

Started byKeerthy <j-keerthy@ti.com>
First post2017-01-10 12:30 +0100
Last post2017-01-11 04:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: netcp: correct netcp_get_stats function signature Keerthy <j-keerthy@ti.com> - 2017-01-10 12:30 +0100
    Re: [PATCH] net: netcp: correct netcp_get_stats function signature David Miller <davem@davemloft.net> - 2017-01-10 18:00 +0100
      Re: [PATCH] net: netcp: correct netcp_get_stats function signature Keerthy <j-keerthy@ti.com> - 2017-01-11 04:30 +0100

#1555165 — [PATCH] net: netcp: correct netcp_get_stats function signature

FromKeerthy <j-keerthy@ti.com>
Date2017-01-10 12:30 +0100
Subject[PATCH] net: netcp: correct netcp_get_stats function signature
Message-ID<sY2MO-Gw-13@gated-at.bofh.it>
Commit: bc1f44709cf2 - net: make ndo_get_stats64 a void function
and
Commit: 6a8162e99ef3 - net: netcp: store network statistics in 64 bits.

The commit 6a8162e99ef3 adds ndo_get_stats64 function as per old
signature which causes compilation error:

drivers/net/ethernet/ti/netcp_core.c:1951:28: error:
initialization from incompatible pointer type
  .ndo_get_stats64        = netcp_get_stats,

Hence correct netcp_get_stats function signature as per
the latest definition.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Fixes: 6a8162e99ef344fc("net: netcp: store network statistics in 64 bits")
---

This is due patches crossing at the same time.
Fixes the compilation error. Only build tested. It would be
good if someone can boot test.

Applies on top of latest next branch.

 drivers/net/ethernet/ti/netcp_core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
index 68a75cc..34852f2 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -1909,7 +1909,7 @@ static int netcp_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
 	return 0;
 }
 
-static struct rtnl_link_stats64 *
+void
 netcp_get_stats(struct net_device *ndev, struct rtnl_link_stats64 *stats)
 {
 	struct netcp_intf *netcp = netdev_priv(ndev);
@@ -1938,8 +1938,6 @@ static int netcp_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
 	stats->rx_errors = p->rx_errors;
 	stats->rx_dropped = p->rx_dropped;
 	stats->tx_dropped = p->tx_dropped;
-
-	return stats;
 }
 
 static const struct net_device_ops netcp_netdev_ops = {
-- 
1.9.1

[toc] | [next] | [standalone]


#1555708

FromDavid Miller <davem@davemloft.net>
Date2017-01-10 18:00 +0100
Message-ID<sY7W9-3M3-25@gated-at.bofh.it>
In reply to#1555165
From: Keerthy <j-keerthy@ti.com>
Date: Tue, 10 Jan 2017 16:56:25 +0530

> @@ -1909,7 +1909,7 @@ static int netcp_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
>  	return 0;
>  }
>  
> -static struct rtnl_link_stats64 *
> +void
>  netcp_get_stats(struct net_device *ndev, struct rtnl_link_stats64 *stats)

Please do not remove the static qualifier.

[toc] | [prev] | [next] | [standalone]


#1556183

FromKeerthy <j-keerthy@ti.com>
Date2017-01-11 04:30 +0100
Message-ID<sYhLP-1zj-3@gated-at.bofh.it>
In reply to#1555708

On Tuesday 10 January 2017 10:22 PM, David Miller wrote:
> From: Keerthy <j-keerthy@ti.com>
> Date: Tue, 10 Jan 2017 16:56:25 +0530
>
>> @@ -1909,7 +1909,7 @@ static int netcp_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
>>  	return 0;
>>  }
>>
>> -static struct rtnl_link_stats64 *
>> +void
>>  netcp_get_stats(struct net_device *ndev, struct rtnl_link_stats64 *stats)
>
> Please do not remove the static qualifier.

Sure. I will add that back.

>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web