From patchwork Wed Jun 29 12:16:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Klauser X-Patchwork-Id: 102580 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DEDD6B744E for ; Wed, 29 Jun 2011 22:25:34 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754382Ab1F2MZ2 (ORCPT ); Wed, 29 Jun 2011 08:25:28 -0400 Received: from mx1.zhaw.ch ([160.85.104.50]:40096 "EHLO mx1.zhaw.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752863Ab1F2MZ1 (ORCPT ); Wed, 29 Jun 2011 08:25:27 -0400 Received: from mx1.zhaw.ch (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 6C1C7B14; Wed, 29 Jun 2011 14:16:01 +0200 (CEST) Received: from fermion.zhaw.ch (inst-232.20.zhaw.ch [160.85.232.20]) by mx1.zhaw.ch (Postfix) with ESMTP id 047ABB11; Wed, 29 Jun 2011 14:16:01 +0200 (CEST) From: Tobias Klauser To: "David S. Miller" , Grant Grundler Cc: netdev@vger.kernel.org Subject: [PATCH net-next] net: de4x5: Omit check for multicast bit in netdev_for_each_mc_addr Date: Wed, 29 Jun 2011 14:16:00 +0200 Message-Id: <1309349760-1776-1-git-send-email-tklauser@distanz.ch> X-Mailer: git-send-email 1.7.5.4 X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.6.29.120315 X-PerlMx-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1400_1499 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS ' Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There is no need to check for the address being a multicast address in the netdev_for_each_mc_addr loop, so remove it. Signed-off-by: Tobias Klauser --- drivers/net/tulip/de4x5.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index efaa1d6..0c3151a 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c @@ -1954,7 +1954,6 @@ SetMulticastFilter(struct net_device *dev) u16 hashcode; u32 omr, crc; char *pa; - unsigned char *addrs; omr = inl(DE4X5_OMR); omr &= ~(OMR_PR | OMR_PM); @@ -1964,9 +1963,7 @@ SetMulticastFilter(struct net_device *dev) omr |= OMR_PM; /* Pass all multicasts */ } else if (lp->setup_f == HASH_PERF) { /* Hash Filtering */ netdev_for_each_mc_addr(ha, dev) { - addrs = ha->addr; - if ((*addrs & 0x01) == 1) { /* multicast address? */ - crc = ether_crc_le(ETH_ALEN, addrs); + crc = ether_crc_le(ETH_ALEN, ha->addr); hashcode = crc & HASH_BITS; /* hashcode is 9 LSb of CRC */ byte = hashcode >> 3; /* bit[3-8] -> byte in filter */ @@ -1977,7 +1974,6 @@ SetMulticastFilter(struct net_device *dev) byte -= 1; } lp->setup_frame[byte] |= bit; - } } } else { /* Perfect filtering */ netdev_for_each_mc_addr(ha, dev) {