]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
net: Document that dev_get_stats() returns the given pointer
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 9 Jul 2010 09:12:41 +0000 (09:12 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Jul 2010 00:41:57 +0000 (17:41 -0700)
Document that dev_get_stats() returns the same stats pointer it was
given.  Remove const qualification from the returned pointer since the
caller may do what it likes with that structure.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/core/dev.c

index 17e95e37aed902de1fd81dc5ae9c524468406d25..c4fedf000541ee4d5759c5e054c6a91626c66061 100644 (file)
@@ -2130,8 +2130,8 @@ extern void               netdev_features_change(struct net_device *dev);
 /* Load a device via the kmod */
 extern void            dev_load(struct net *net, const char *name);
 extern void            dev_mcast_init(void);
-extern const struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
-                                                    struct rtnl_link_stats64 *storage);
+extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
+                                              struct rtnl_link_stats64 *storage);
 extern void            dev_txq_stats_fold(const struct net_device *dev,
                                           struct rtnl_link_stats64 *stats);
 
index 79ee26ef5095ddd7742e1ec7f1e4eb5cd8e2b2ce..e2b9fa2c917e1ccc99a7444b298270185acf5e35 100644 (file)
@@ -5323,13 +5323,13 @@ static void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
  *     @dev: device to get statistics from
  *     @storage: place to store stats
  *
- *     Get network statistics from device. The device driver may provide
- *     its own method by setting dev->netdev_ops->get_stats64 or
- *     dev->netdev_ops->get_stats; otherwise the internal statistics
- *     structure is used.
+ *     Get network statistics from device. Return @storage.
+ *     The device driver may provide its own method by setting
+ *     dev->netdev_ops->get_stats64 or dev->netdev_ops->get_stats;
+ *     otherwise the internal statistics structure is used.
  */
-const struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
-                                             struct rtnl_link_stats64 *storage)
+struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
+                                       struct rtnl_link_stats64 *storage)
 {
        const struct net_device_ops *ops = dev->netdev_ops;