From owner-svn-src-head@FreeBSD.ORG Sun Feb 28 18:06:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08B22106566C; Sun, 28 Feb 2010 18:06:55 +0000 (UTC) (envelope-from ticso@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC4098FC1E; Sun, 28 Feb 2010 18:06:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1SI6sqY052706; Sun, 28 Feb 2010 18:06:54 GMT (envelope-from ticso@svn.freebsd.org) Received: (from ticso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1SI6sGl052704; Sun, 28 Feb 2010 18:06:54 GMT (envelope-from ticso@svn.freebsd.org) Message-Id: <201002281806.o1SI6sGl052704@svn.freebsd.org> From: Bernd Walter Date: Sun, 28 Feb 2010 18:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204476 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2010 18:06:55 -0000 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); }