Skip to content

Commit

Permalink
fec_mpc52xx: write in C...
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro authored and Jeff Garzik committed Dec 23, 2007
1 parent b1e247a commit cc154ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/fec_mpc52xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,9 @@ static void mpc52xx_fec_reset_stats(struct net_device *dev)
struct mpc52xx_fec __iomem *fec = priv->fec;

out_be32(&fec->mib_control, FEC_MIB_DISABLE);
memset_io(&fec->rmon_t_drop, 0, (__force u32)&fec->reserved10 -
(__force u32)&fec->rmon_t_drop);
memset_io(&fec->rmon_t_drop, 0,
offsetof(struct mpc52xx_fec, reserved10) -
offsetof(struct mpc52xx_fec, rmon_t_drop));
out_be32(&fec->mib_control, 0);

memset(&dev->stats, 0, sizeof(dev->stats));
Expand Down

0 comments on commit cc154ac

Please sign in to comment.