projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b1e247a
)
fec_mpc52xx: write in C...
author
Al Viro
<
[email protected]
>
Sat, 22 Dec 2007 18:56:53 +0000
(18:56 +0000)
committer
Jeff Garzik
<
[email protected]
>
Sun, 23 Dec 2007 03:53:07 +0000
(22:53 -0500)
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 <
[email protected]
>
Signed-off-by: Jeff Garzik <
[email protected]
>
drivers/net/fec_mpc52xx.c
patch
|
blob
|
history
diff --git
a/drivers/net/fec_mpc52xx.c
b/drivers/net/fec_mpc52xx.c
index 79f7eade477356938e113543e354baabef3d81be..f91ee700e605c051990afb27d350ac38c296b6ff 100644
(file)
--- 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)
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));