diff options
author | Eric Biggers <ebiggers@google.com> | 2025-03-05 04:58:30 +0300 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2025-03-10 19:29:29 +0300 |
commit | 415999ea30015681d2ba32e78cb651d23d33cb53 (patch) | |
tree | fe6f2c666a5536b5bceebadf2a6145c45dce8da3 | |
parent | 7715f8cfe5df822617db618c783db47504adfc90 (diff) | |
download | linux-415999ea30015681d2ba32e78cb651d23d33cb53.tar.xz |
lib/crc_kunit.c: update comment in crc_benchmark()
None of the CRC library functions use __pure anymore, so the comment in
crc_benchmark() is outdated. But the comment was not really correct
anyway, since the CRC computation could (in principle) be optimized out
regardless of __pure. Update the comment to have a proper explanation.
Link: https://lore.kernel.org/r/20250305015830.37813-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
-rw-r--r-- | lib/crc_kunit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/crc_kunit.c b/lib/crc_kunit.c index 0e15eb244b20..585c48b65cef 100644 --- a/lib/crc_kunit.c +++ b/lib/crc_kunit.c @@ -226,8 +226,9 @@ crc_benchmark(struct kunit *test, }; size_t len, i, j, num_iters; /* - * Some of the CRC library functions are marked as __pure, so use - * volatile to ensure that all calls are really made as intended. + * The CRC value that this function computes in a series of calls to + * crc_func is never actually used, so use volatile to ensure that the + * computations are done as intended and don't all get optimized out. */ volatile u64 crc = 0; u64 t; |