]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
lib/crc_kunit.c: update comment in crc_benchmark()
authorEric Biggers <ebiggers@google.com>
Wed, 5 Mar 2025 01:58:30 +0000 (17:58 -0800)
committerEric Biggers <ebiggers@google.com>
Mon, 10 Mar 2025 16:29:29 +0000 (09:29 -0700)
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>
lib/crc_kunit.c

index 0e15eb244b20a0813ad63df2b1413892af2cce7d..585c48b65cefd30c5ab17cf6ed73eeae14e355b5 100644 (file)
@@ -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;