aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fec_mpc52xx.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-12-22 13:56:53 -0500
committerJeff Garzik <jeff@garzik.org>2007-12-22 22:53:07 -0500
commitcc154ac64aa8d3396b187f64cef01ce67f433324 (patch)
treedd112547d2d35d8d2c1d2cc7854619514d9e3169 /drivers/net/fec_mpc52xx.c
parentb1e247ad8e4ff29b5c7fa2b9a081b4a0f483b0d3 (diff)
fec_mpc52xx: write in C...
If you need to find a difference between addresses of two struct members, subtract offsetof() or cast addresses to char * and subtract those if you prefer it that way. Doing that same with s/char */u32/, OTOH... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/fec_mpc52xx.c')
-rw-r--r--drivers/net/fec_mpc52xx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index 79f7eade4773..f91ee700e605 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -568,8 +568,9 @@ static void mpc52xx_fec_reset_stats(struct net_device *dev)
568 struct mpc52xx_fec __iomem *fec = priv->fec; 568 struct mpc52xx_fec __iomem *fec = priv->fec;
569 569
570 out_be32(&fec->mib_control, FEC_MIB_DISABLE); 570 out_be32(&fec->mib_control, FEC_MIB_DISABLE);
571 memset_io(&fec->rmon_t_drop, 0, (__force u32)&fec->reserved10 - 571 memset_io(&fec->rmon_t_drop, 0,
572 (__force u32)&fec->rmon_t_drop); 572 offsetof(struct mpc52xx_fec, reserved10) -
573 offsetof(struct mpc52xx_fec, rmon_t_drop));
573 out_be32(&fec->mib_control, 0); 574 out_be32(&fec->mib_control, 0);
574 575
575 memset(&dev->stats, 0, sizeof(dev->stats)); 576 memset(&dev->stats, 0, sizeof(dev->stats));