aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-07-10 05:11:40 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-07-10 05:11:40 +0200
commitbb3b82bad1b9d45d9fccd0932e75999c04acacbf (patch)
treed6e0d5693316ab4bc7d78e62baf00c4146122a26
parentnetdevice: add netdev_pub helper function (diff)
downloadlinux-dev-bb3b82bad1b9d45d9fccd0932e75999c04acacbf.tar.xz
linux-dev-bb3b82bad1b9d45d9fccd0932e75999c04acacbf.zip
ioc3-eth: use netdev_pub instead of handrolling alignmentjd/netdev-pub
It's safer to use the generic library function for this, rather than reinventing it here with hard-coded alignment values. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--drivers/net/ethernet/sgi/ioc3-eth.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
index b607936e1b3e..514eca163ea5 100644
--- a/drivers/net/ethernet/sgi/ioc3-eth.c
+++ b/drivers/net/ethernet/sgi/ioc3-eth.c
@@ -96,11 +96,6 @@ struct ioc3_private {
struct timer_list ioc3_timer;
};
-static inline struct net_device *priv_netdev(struct ioc3_private *dev)
-{
- return (void *)dev - ((sizeof(struct net_device) + 31) & ~31);
-}
-
static int ioc3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static void ioc3_set_multicast_list(struct net_device *dev);
static int ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev);
@@ -427,7 +422,7 @@ static void ioc3_get_eaddr_nic(struct ioc3_private *ip)
nic[i] = nic_read_byte(ioc3);
for (i = 2; i < 8; i++)
- priv_netdev(ip)->dev_addr[i - 2] = nic[i];
+ netdev_pub(ip)->dev_addr[i - 2] = nic[i];
}
/*
@@ -439,7 +434,7 @@ static void ioc3_get_eaddr(struct ioc3_private *ip)
{
ioc3_get_eaddr_nic(ip);
- printk("Ethernet address is %pM.\n", priv_netdev(ip)->dev_addr);
+ printk("Ethernet address is %pM.\n", netdev_pub(ip)->dev_addr);
}
static void __ioc3_set_mac_address(struct net_device *dev)
@@ -790,7 +785,7 @@ static void ioc3_timer(unsigned long data)
*/
static int ioc3_mii_init(struct ioc3_private *ip)
{
- struct net_device *dev = priv_netdev(ip);
+ struct net_device *dev = netdev_pub(ip);
int i, found = 0, res = 0;
int ioc3_phy_workaround = 1;
u16 word;