From 1a822ea52ad0d844805db32333a51d41ffcdf869 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 12 Jun 2025 11:38:52 -0700 Subject: [PATCH] lib/crc: Explicitly include Fix build warnings with W=1 that started appearing after commit a934a57a42f6 ("scripts/misc-check: check missing #include 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 --- lib/crc/crc-ccitt.c | 5 +++-- lib/crc/crc-itu-t.c | 5 +++-- lib/crc/crc-t10dif-main.c | 5 +++-- lib/crc/crc16.c | 5 +++-- lib/crc/crc32-main.c | 1 + lib/crc/crc4.c | 1 + lib/crc/crc64-main.c | 4 +++- lib/crc/crc7.c | 5 +++-- lib/crc/crc8.c | 3 ++- 9 files changed, 22 insertions(+), 12 deletions(-) diff --git a/lib/crc/crc-ccitt.c b/lib/crc/crc-ccitt.c index 8d2bc419230b3..f8692c3de101a 100644 --- a/lib/crc/crc-ccitt.c +++ b/lib/crc/crc-ccitt.c @@ -1,8 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-only -#include -#include #include +#include +#include +#include /* * This mysterious table is just the CRC of each possible byte. It can be diff --git a/lib/crc/crc-itu-t.c b/lib/crc/crc-itu-t.c index 1d26a1647da53..6e413a290f54f 100644 --- a/lib/crc/crc-itu-t.c +++ b/lib/crc/crc-itu-t.c @@ -3,9 +3,10 @@ * crc-itu-t.c */ -#include -#include #include +#include +#include +#include /* CRC table for the CRC ITU-T V.41 0x1021 (x^16 + x^12 + x^5 + 1) */ const u16 crc_itu_t_table[256] = { diff --git a/lib/crc/crc-t10dif-main.c b/lib/crc/crc-t10dif-main.c index bc91f38881848..08dde238e89ff 100644 --- a/lib/crc/crc-t10dif-main.c +++ b/lib/crc/crc-t10dif-main.c @@ -6,9 +6,10 @@ * Written by Martin K. Petersen */ -#include -#include #include +#include +#include +#include /* * Table generated using the following polynomial: diff --git a/lib/crc/crc16.c b/lib/crc/crc16.c index 9c71eda9bf4b9..931660a8cbaaa 100644 --- a/lib/crc/crc16.c +++ b/lib/crc/crc16.c @@ -3,9 +3,10 @@ * crc16.c */ -#include -#include #include +#include +#include +#include /** CRC table for the CRC-16. The poly is 0x8005 (x^16 + x^15 + x^2 + 1) */ static const u16 crc16_table[256] = { diff --git a/lib/crc/crc32-main.c b/lib/crc/crc32-main.c index 7843512ffef43..fbb90c9006e5e 100644 --- a/lib/crc/crc32-main.c +++ b/lib/crc/crc32-main.c @@ -25,6 +25,7 @@ /* see: Documentation/staging/crc32.rst for a description of algorithms */ #include +#include #include #include diff --git a/lib/crc/crc4.c b/lib/crc/crc4.c index e7e1779c67d91..8e83fbe60bdc9 100644 --- a/lib/crc/crc4.c +++ b/lib/crc/crc4.c @@ -4,6 +4,7 @@ */ #include +#include #include static const uint8_t crc4_tab[] = { diff --git a/lib/crc/crc64-main.c b/lib/crc/crc64-main.c index 038afc7f4d444..1337036010fe0 100644 --- a/lib/crc/crc64-main.c +++ b/lib/crc/crc64-main.c @@ -33,9 +33,11 @@ * Author: Coly Li */ +#include +#include #include #include -#include + #include "crc64table.h" static inline u64 __maybe_unused diff --git a/lib/crc/crc7.c b/lib/crc/crc7.c index 8dd991cc61146..46b95d7ac6ce0 100644 --- a/lib/crc/crc7.c +++ b/lib/crc/crc7.c @@ -3,9 +3,10 @@ * crc7.c */ -#include -#include #include +#include +#include +#include /* * Table for CRC-7 (polynomial x^7 + x^3 + 1). diff --git a/lib/crc/crc8.c b/lib/crc/crc8.c index 1ad8e501d9b69..329c52158c455 100644 --- a/lib/crc/crc8.c +++ b/lib/crc/crc8.c @@ -16,8 +16,9 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include #include +#include +#include #include /** -- 2.47.2