Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d258b48 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Herbert Xu
Browse files

net: ethernet: Use existing define with polynomial



Do not define again the polynomial but use header with existing define.

Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent f7aee878
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@
#include <linux/clk.h>
#include <linux/bitrev.h>
#include <linux/crc32.h>
#include <linux/crc32poly.h>

#include "xgbe.h"
#include "xgbe-common.h"
@@ -887,7 +888,6 @@ static int xgbe_disable_rx_vlan_filtering(struct xgbe_prv_data *pdata)

static u32 xgbe_vid_crc32_le(__le16 vid_le)
{
	u32 poly = 0xedb88320;	/* CRCPOLY_LE */
	u32 crc = ~0;
	u32 temp = 0;
	unsigned char *data = (unsigned char *)&vid_le;
@@ -904,7 +904,7 @@ static u32 xgbe_vid_crc32_le(__le16 vid_le)
		data_byte >>= 1;

		if (temp)
			crc ^= poly;
			crc ^= CRC32_POLY_LE;
	}

	return crc;
+2 −6
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/crc32.h>
#include <linux/crc32poly.h>
#include <linux/bitrev.h>
#include <linux/ethtool.h>
#include <linux/slab.h>
@@ -37,11 +38,6 @@
#define trunc_page(x)	((void *)(((unsigned long)(x)) & ~((unsigned long)(PAGE_SIZE - 1))))
#define round_page(x)	trunc_page(((unsigned long)(x)) + ((unsigned long)(PAGE_SIZE - 1)))

/*
 * CRC polynomial - used in working out multicast filter bits.
 */
#define ENET_CRCPOLY 0x04c11db7

/* switch to use multicast code lifted from sunhme driver */
#define SUNHME_MULTICAST

@@ -838,7 +834,7 @@ crc416(unsigned int curval, unsigned short nxtval)
		next = next >> 1;

		/* do the XOR */
		if (high_crc_set ^ low_data_set) cur = cur ^ ENET_CRCPOLY;
		if (high_crc_set ^ low_data_set) cur = cur ^ CRC32_POLY_BE;
	}
	return cur;
}
+2 −1
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@
#include <linux/ssb/ssb_driver_gige.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/crc32poly.h>

#include <net/checksum.h>
#include <net/ip.h>
@@ -9707,7 +9708,7 @@ static inline u32 calc_crc(unsigned char *buf, int len)
			reg >>= 1;

			if (tmp)
				reg ^= 0xedb88320;
				reg ^= CRC32_POLY_LE;
		}
	}

+2 −2
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/clk.h>
#include <linux/crc32poly.h>
#include <linux/platform_device.h>
#include <linux/mdio.h>
#include <linux/phy.h>
@@ -2949,7 +2950,6 @@ fec_enet_close(struct net_device *ndev)
 */

#define FEC_HASH_BITS	6		/* #bits in hash */
#define CRC32_POLY	0xEDB88320

static void set_multicast_list(struct net_device *ndev)
{
@@ -2989,7 +2989,7 @@ static void set_multicast_list(struct net_device *ndev)
			data = ha->addr[i];
			for (bit = 0; bit < 8; bit++, data >>= 1) {
				crc = (crc >> 1) ^
				(((crc ^ data) & 1) ? CRC32_POLY : 0);
				(((crc ^ data) & 1) ? CRC32_POLY_LE : 0);
			}
		}

+0 −3
Original line number Diff line number Diff line
@@ -2,9 +2,6 @@
#ifndef FS_ENET_FEC_H
#define FS_ENET_FEC_H

/* CRC polynomium used by the FEC for the multicast group filtering */
#define FEC_CRC_POLY   0x04C11DB7

#define FEC_MAX_MULTICAST_ADDRS	64

/* Interrupt events/masks.
Loading