Author: ticso
Date: Sun Feb 28 18:06:54 2010
New Revision: 204476
URL: http://svn.freebsd.org/changeset/base/204476

Log:
  simplify hash calculation

Modified:
  head/sys/arm/at91/if_ate.c

Modified: head/sys/arm/at91/if_ate.c
==============================================================================
--- head/sys/arm/at91/if_ate.c  Sun Feb 28 17:19:22 2010        (r204475)
+++ head/sys/arm/at91/if_ate.c  Sun Feb 28 18:06:54 2010        (r204476)
@@ -384,12 +384,8 @@ static uint32_t
 ate_mac_hash(const uint8_t *buf)
 {
        uint32_t index = 0;
-       uint8_t bit;
-       uint8_t bitshift;
        for (int i = 0; i < 48; i++) {
-               bit = i / 6;
-               bitshift =  i - bit * 6;
-               index ^= ((buf[i >> 3] >> (i & 7)) & 1) << bitshift;
+               index ^= ((buf[i >> 3] >> (i & 7)) & 1) << (i % 6);
        }
        return (index);
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to