[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250621012221.4351-1-ebiggers@kernel.org>
Date: Fri, 20 Jun 2025 18:22:21 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: linux-crypto@...r.kernel.org,
Ard Biesheuvel <ardb@...nel.org>,
Eric Biggers <ebiggers@...nel.org>
Subject: [PATCH] lib/crc: Move __maybe_unused after function return type
While both locations work, having the attribute go after the return type
is the more common convention.
Signed-off-by: Eric Biggers <ebiggers@...nel.org>
---
lib/crc/crc-t10dif-main.c | 2 +-
lib/crc/crc32-main.c | 6 +++---
lib/crc/crc64-main.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/crc/crc-t10dif-main.c b/lib/crc/crc-t10dif-main.c
index 0c595cb0d4c1c..08dde238e89ff 100644
--- a/lib/crc/crc-t10dif-main.c
+++ b/lib/crc/crc-t10dif-main.c
@@ -49,11 +49,11 @@ static const u16 t10_dif_crc_table[256] = {
0xA415, 0x2FA2, 0x38CC, 0xB37B, 0x1610, 0x9DA7, 0x8AC9, 0x017E,
0x1F65, 0x94D2, 0x83BC, 0x080B, 0xAD60, 0x26D7, 0x31B9, 0xBA0E,
0xF0D8, 0x7B6F, 0x6C01, 0xE7B6, 0x42DD, 0xC96A, 0xDE04, 0x55B3
};
-static inline __maybe_unused u16
+static inline u16 __maybe_unused
crc_t10dif_generic(u16 crc, const u8 *p, size_t len)
{
while (len--)
crc = (crc << 8) ^ t10_dif_crc_table[(crc >> 8) ^ *p++];
return crc;
diff --git a/lib/crc/crc32-main.c b/lib/crc/crc32-main.c
index 70c4ef170526d..fbb90c9006e5e 100644
--- a/lib/crc/crc32-main.c
+++ b/lib/crc/crc32-main.c
@@ -29,27 +29,27 @@
#include <linux/module.h>
#include <linux/types.h>
#include "crc32table.h"
-static inline __maybe_unused u32
+static inline u32 __maybe_unused
crc32_le_base(u32 crc, const u8 *p, size_t len)
{
while (len--)
crc = (crc >> 8) ^ crc32table_le[(crc & 255) ^ *p++];
return crc;
}
-static inline __maybe_unused u32
+static inline u32 __maybe_unused
crc32_be_base(u32 crc, const u8 *p, size_t len)
{
while (len--)
crc = (crc << 8) ^ crc32table_be[(crc >> 24) ^ *p++];
return crc;
}
-static inline __maybe_unused u32
+static inline u32 __maybe_unused
crc32c_base(u32 crc, const u8 *p, size_t len)
{
while (len--)
crc = (crc >> 8) ^ crc32ctable_le[(crc & 255) ^ *p++];
return crc;
diff --git a/lib/crc/crc64-main.c b/lib/crc/crc64-main.c
index aef8282b63fba..1337036010fe0 100644
--- a/lib/crc/crc64-main.c
+++ b/lib/crc/crc64-main.c
@@ -38,19 +38,19 @@
#include <linux/module.h>
#include <linux/types.h>
#include "crc64table.h"
-static inline __maybe_unused u64
+static inline u64 __maybe_unused
crc64_be_generic(u64 crc, const u8 *p, size_t len)
{
while (len--)
crc = (crc << 8) ^ crc64table[(crc >> 56) ^ *p++];
return crc;
}
-static inline __maybe_unused u64
+static inline u64 __maybe_unused
crc64_nvme_generic(u64 crc, const u8 *p, size_t len)
{
while (len--)
crc = (crc >> 8) ^ crc64nvmetable[(crc & 0xff) ^ *p++];
return crc;
base-commit: 5453f75923b1e2ea471aa67aec64f98164faa352
--
2.50.0
Powered by blists - more mailing lists