Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cc154ac64aa8d3396b187f64cef01ce67f433324
Commit:     cc154ac64aa8d3396b187f64cef01ce67f433324
Parent:     b1e247ad8e4ff29b5c7fa2b9a081b4a0f483b0d3
Author:     Al Viro <[EMAIL PROTECTED]>
AuthorDate: Sat Dec 22 18:56:53 2007 +0000
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Sat Dec 22 22:53:07 2007 -0500

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/fec_mpc52xx.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index 79f7ead..f91ee70 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)
        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));
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to