From 2f4a4fd5fe75a6f935cdf004223d4d4d10e7d06f Mon Sep 17 00:00:00 2001
From: Patrick Bruenn
Date: Thu, 5 Jun 2014 16:40:01 +0200
Subject: [PATCH] - don't use compat.h in the mainline driver - correct
constness of function pointer declarations
---
devices/ccat/module.c | 1 -
devices/ccat/module.h | 16 ++++++++--------
devices/ccat/netdev.c | 9 +--------
devices/ccat/update.c | 1 -
4 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/devices/ccat/module.c b/devices/ccat/module.c
index e044671f..a1b6fca2 100644
--- a/devices/ccat/module.c
+++ b/devices/ccat/module.c
@@ -22,7 +22,6 @@
#include
#include
#include
-#include "compat.h"
#include "module.h"
#include "netdev.h"
#include "update.h"
diff --git a/devices/ccat/module.h b/devices/ccat/module.h
index a4872070..f0e4b4d3 100644
--- a/devices/ccat/module.h
+++ b/devices/ccat/module.h
@@ -200,15 +200,15 @@ struct ccat_eth_priv {
atomic64_t tx_bytes;
atomic64_t tx_dropped;
ec_device_t *ecdev;
- void (*carrier_off) (struct net_device * const netdev);
- bool (*carrier_ok) (struct net_device *const netdev);
- void (*carrier_on) (struct net_device * const netdev);
+ void (*carrier_off) (struct net_device * netdev);
+ bool (*carrier_ok) (const struct net_device * netdev);
+ void (*carrier_on) (struct net_device * netdev);
void (*kfree_skb_any) (struct sk_buff * skb);
- void (*start_queue) (struct net_device * const netdev);
- void (*stop_queue) (struct net_device * const netdev);
- void (*tx_fifo_full) (struct ccat_eth_priv * const priv,
- const struct ccat_eth_frame * const frame);
- void (*unregister) (struct net_device * const netdev);
+ void (*start_queue) (struct net_device * netdev);
+ void (*stop_queue) (struct net_device * netdev);
+ void (*tx_fifo_full) (struct ccat_eth_priv * priv,
+ const struct ccat_eth_frame * frame);
+ void (*unregister) (struct net_device * netdev);
};
/**
diff --git a/devices/ccat/netdev.c b/devices/ccat/netdev.c
index cec7c897..d4333aad 100644
--- a/devices/ccat/netdev.c
+++ b/devices/ccat/netdev.c
@@ -25,7 +25,6 @@
#include
#include
-#include "compat.h"
#include "module.h"
#include "netdev.h"
@@ -50,10 +49,8 @@ static const u8 frameForwardEthernetFrames[] = {
static void ec_poll(struct net_device *dev);
static enum hrtimer_restart poll_timer_callback(struct hrtimer *timer);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
static struct rtnl_link_stats64 *ccat_eth_get_stats64(struct net_device *dev, struct rtnl_link_stats64
*storage);
-#endif
static int ccat_eth_open(struct net_device *dev);
static netdev_tx_t ccat_eth_start_xmit(struct sk_buff *skb,
struct net_device *dev);
@@ -62,9 +59,7 @@ static void ccat_eth_xmit_raw(struct net_device *dev, const char *data,
size_t len);
static const struct net_device_ops ccat_eth_netdev_ops = {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
.ndo_get_stats64 = ccat_eth_get_stats64,
-#endif
.ndo_open = ccat_eth_open,
.ndo_start_xmit = ccat_eth_start_xmit,
.ndo_stop = ccat_eth_stop,
@@ -75,7 +70,7 @@ static void ecdev_kfree_skb_any(struct sk_buff *skb)
/* never release a skb in EtherCAT mode */
}
-static bool ecdev_carrier_ok(struct net_device *const netdev)
+static bool ecdev_carrier_ok(const struct net_device *const netdev)
{
struct ccat_eth_priv *const priv = netdev_priv(netdev);
return ecdev_get_link(priv->ecdev);
@@ -242,7 +237,6 @@ inline static size_t ccat_eth_priv_read_link_state(const struct ccat_eth_priv
return (1 << 24) == (ioread32(priv->reg.mii + 0x8 + 4) & (1 << 24));
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
static struct rtnl_link_stats64 *ccat_eth_get_stats64(struct net_device *dev, struct rtnl_link_stats64
*storage)
{
@@ -281,7 +275,6 @@ static struct rtnl_link_stats64 *ccat_eth_get_stats64(struct net_device *dev, st
//TODO __u64 tx_compressed;
return storage;
}
-#endif
struct ccat_eth_priv *ccat_eth_init(const struct ccat_device *const ccatdev,
const void __iomem * const addr)
diff --git a/devices/ccat/update.c b/devices/ccat/update.c
index ee5c0bbf..cd4e82c0 100644
--- a/devices/ccat/update.c
+++ b/devices/ccat/update.c
@@ -23,7 +23,6 @@
#include
#include
#include
-#include "compat.h"
#include "module.h"
#include "update.h"