From: Eric Biggers <ebiggers@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: linux-crypto@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
Eric Biggers <ebiggers@kernel.org>
Subject: [PATCH] lib/crc: Move __maybe_unused after function return type
Date: Fri, 20 Jun 2025 18:22:21 -0700 [thread overview]
Message-ID: <20250621012221.4351-1-ebiggers@kernel.org> (raw)
While both locations work, having the attribute go after the return type
is the more common convention.
Signed-off-by: Eric Biggers <ebiggers@kernel.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
reply other threads:[~2025-06-21 1:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250621012221.4351-1-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=ardb@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.