Skip to content

Commit 1a822ea

Browse files
author
Eric Biggers
committed
lib/crc: Explicitly include <linux/export.h>
Fix build warnings with W=1 that started appearing after commit a934a57 ("scripts/misc-check: check missing #include <linux/export.h> when W=1"). While at it, sort the include lists alphabetically. Link: https://lore.kernel.org/r/20250612183852.114878-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
1 parent 61d01fb commit 1a822ea

9 files changed

Lines changed: 22 additions & 12 deletions

File tree

lib/crc/crc-ccitt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22

3-
#include <linux/types.h>
4-
#include <linux/module.h>
53
#include <linux/crc-ccitt.h>
4+
#include <linux/export.h>
5+
#include <linux/module.h>
6+
#include <linux/types.h>
67

78
/*
89
* This mysterious table is just the CRC of each possible byte. It can be

lib/crc/crc-itu-t.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
* crc-itu-t.c
44
*/
55

6-
#include <linux/types.h>
7-
#include <linux/module.h>
86
#include <linux/crc-itu-t.h>
7+
#include <linux/export.h>
8+
#include <linux/module.h>
9+
#include <linux/types.h>
910

1011
/* CRC table for the CRC ITU-T V.41 0x1021 (x^16 + x^12 + x^5 + 1) */
1112
const u16 crc_itu_t_table[256] = {

lib/crc/crc-t10dif-main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
* Written by Martin K. Petersen <martin.petersen@oracle.com>
77
*/
88

9-
#include <linux/types.h>
10-
#include <linux/module.h>
119
#include <linux/crc-t10dif.h>
10+
#include <linux/export.h>
11+
#include <linux/module.h>
12+
#include <linux/types.h>
1213

1314
/*
1415
* Table generated using the following polynomial:

lib/crc/crc16.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
* crc16.c
44
*/
55

6-
#include <linux/types.h>
7-
#include <linux/module.h>
86
#include <linux/crc16.h>
7+
#include <linux/export.h>
8+
#include <linux/module.h>
9+
#include <linux/types.h>
910

1011
/** CRC table for the CRC-16. The poly is 0x8005 (x^16 + x^15 + x^2 + 1) */
1112
static const u16 crc16_table[256] = {

lib/crc/crc32-main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
/* see: Documentation/staging/crc32.rst for a description of algorithms */
2626

2727
#include <linux/crc32.h>
28+
#include <linux/export.h>
2829
#include <linux/module.h>
2930
#include <linux/types.h>
3031

lib/crc/crc4.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include <linux/crc4.h>
7+
#include <linux/export.h>
78
#include <linux/module.h>
89

910
static const uint8_t crc4_tab[] = {

lib/crc/crc64-main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@
3333
* Author: Coly Li <colyli@suse.de>
3434
*/
3535

36+
#include <linux/crc64.h>
37+
#include <linux/export.h>
3638
#include <linux/module.h>
3739
#include <linux/types.h>
38-
#include <linux/crc64.h>
40+
3941
#include "crc64table.h"
4042

4143
static inline u64 __maybe_unused

lib/crc/crc7.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
* crc7.c
44
*/
55

6-
#include <linux/types.h>
7-
#include <linux/module.h>
86
#include <linux/crc7.h>
7+
#include <linux/export.h>
8+
#include <linux/module.h>
9+
#include <linux/types.h>
910

1011
/*
1112
* Table for CRC-7 (polynomial x^7 + x^3 + 1).

lib/crc/crc8.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616

1717
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1818

19-
#include <linux/module.h>
2019
#include <linux/crc8.h>
20+
#include <linux/export.h>
21+
#include <linux/module.h>
2122
#include <linux/printk.h>
2223

2324
/**

0 commit comments

Comments
 (0)