Skip to content

Commit 9ecdb98

Browse files
krzkherbertx
authored andcommitted
staging: rtl: Use existing define with polynomial
Do not define again the polynomial but use header with existing define. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 5d258b4 commit 9ecdb98

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

drivers/staging/rtl8712/rtl871x_security.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <linux/uaccess.h>
4141
#include <asm/byteorder.h>
4242
#include <linux/atomic.h>
43+
#include <linux/crc32poly.h>
4344
#include <linux/semaphore.h>
4445

4546
#include "osdep_service.h"
@@ -49,8 +50,6 @@
4950

5051
/* =====WEP related===== */
5152

52-
#define CRC32_POLY 0x04c11db7
53-
5453
struct arc4context {
5554
u32 x;
5655
u32 y;
@@ -135,7 +134,7 @@ static void crc32_init(void)
135134
for (i = 0; i < 256; ++i) {
136135
k = crc32_reverseBit((u8)i);
137136
for (c = ((u32)k) << 24, j = 8; j > 0; --j)
138-
c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY : (c << 1);
137+
c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY_BE : (c << 1);
139138
p1 = (u8 *)&crc32_table[i];
140139
p1[0] = crc32_reverseBit(p[3]);
141140
p1[1] = crc32_reverseBit(p[2]);

drivers/staging/rtl8723bs/core/rtw_security.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
******************************************************************************/
77
#define _RTW_SECURITY_C_
88

9+
#include <linux/crc32poly.h>
910
#include <drv_types.h>
1011
#include <rtw_debug.h>
1112

@@ -87,8 +88,6 @@ const char *security_type_str(u8 value)
8788

8889
/* WEP related ===== */
8990

90-
#define CRC32_POLY 0x04c11db7
91-
9291
struct arc4context {
9392
u32 x;
9493
u32 y;
@@ -178,7 +177,7 @@ static void crc32_init(void)
178177
for (i = 0; i < 256; ++i) {
179178
k = crc32_reverseBit((u8)i);
180179
for (c = ((u32)k) << 24, j = 8; j > 0; --j) {
181-
c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY : (c << 1);
180+
c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY_BE : (c << 1);
182181
}
183182
p1 = (u8 *)&crc32_table[i];
184183

0 commit comments

Comments
 (0)