netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Tobias Klauser <tklauser@distanz.ch>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 14/15] e1000: Use is_broadcast_ether_addr/is_multicast_ether_addr helpers
Date: Tue, 27 May 2014 02:12:30 -0700	[thread overview]
Message-ID: <1401181951-31358-15-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1401181951-31358-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Tobias Klauser <tklauser@distanz.ch>

Use the is_broadcast_ether_addr/is_multicast_ether_addr helper functions
from linux/etherdevice.h instead of open coding them.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000/e1000_hw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_hw.c b/drivers/net/ethernet/intel/e1000/e1000_hw.c
index c1d3fdb..e9b07cc 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_hw.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_hw.c
@@ -4877,10 +4877,10 @@ void e1000_tbi_adjust_stats(struct e1000_hw *hw, struct e1000_hw_stats *stats,
 	 * since the test for a multicast frame will test positive on
 	 * a broadcast frame.
 	 */
-	if ((mac_addr[0] == (u8) 0xff) && (mac_addr[1] == (u8) 0xff))
+	if (is_broadcast_ether_addr(mac_addr))
 		/* Broadcast packet */
 		stats->bprc++;
-	else if (*mac_addr & 0x01)
+	else if (is_multicast_ether_addr(mac_addr))
 		/* Multicast packet */
 		stats->mprc++;
 
-- 
1.9.3

  parent reply	other threads:[~2014-05-27  9:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27  9:12 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-05-27  9:12 ` [net-next 01/15] ixgbe: fix linking at 100Mbps on copper devices with MNG FW enabled Jeff Kirsher
2014-05-27  9:12 ` [net-next 02/15] ixgbe: rename ixgbe_ptp_enable to ixgbe_ptp_feature_enable Jeff Kirsher
2014-05-27  9:12 ` [net-next 03/15] ixgbe: extract the hardware setup from the ixgbe_ptp_set_ts_config Jeff Kirsher
2014-05-27  9:12 ` [net-next 04/15] ixgbe: allow ixgbe_ptp_reset to maintain current hwtstamp config Jeff Kirsher
2014-05-27  9:12 ` [net-next 05/15] ixgbe: extract PTP clock device from ptp_init Jeff Kirsher
2014-05-27  9:12 ` [net-next 06/15] ixgbe: separate the PTP suspend and stop actions Jeff Kirsher
2014-05-27  9:12 ` [net-next 07/15] ixgbe: avoid duplicate code in suspend and stop paths Jeff Kirsher
2014-05-27  9:12 ` [net-next 08/15] e1000e: Failure to write SHRA turns on PROMISC mode Jeff Kirsher
2014-05-28 14:06   ` Vlad Yasevich
2014-05-27  9:12 ` [net-next 09/15] e1000e: 82574/82583 TimeSync errata for SYSTIM read Jeff Kirsher
2014-05-27  9:12 ` [net-next 10/15] e1000e: Cleanup parenthesis around return value Jeff Kirsher
2014-05-27  9:12 ` [net-next 11/15] e1000e: Fix expand setting EEE link info to all affected parts Jeff Kirsher
2014-05-27  9:12 ` [net-next 12/15] e1000e: Out of line __ew32_prepare/__ew32 Jeff Kirsher
2014-05-27  9:12 ` [net-next 13/15] igb: remove redundant PHY power down register write Jeff Kirsher
2014-05-27  9:12 ` Jeff Kirsher [this message]
2014-05-27  9:12 ` [net-next 15/15] i40evf: Use is_multicast_ether_addr helper Jeff Kirsher
2014-05-28 16:42 ` [net-next 00/15][pull request] Intel Wired LAN Driver Updates David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401181951-31358-15-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    --cc=tklauser@distanz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).