Skip to content

Commit 415999e

Browse files
committed
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/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 7715f8c commit 415999e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/crc_kunit.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,9 @@ crc_benchmark(struct kunit *test,
226226
};
227227
size_t len, i, j, num_iters;
228228
/*
229-
* Some of the CRC library functions are marked as __pure, so use
230-
* volatile to ensure that all calls are really made as intended.
229+
* The CRC value that this function computes in a series of calls to
230+
* crc_func is never actually used, so use volatile to ensure that the
231+
* computations are done as intended and don't all get optimized out.
231232
*/
232233
volatile u64 crc = 0;
233234
u64 t;

0 commit comments

Comments
 (0)