Skip to content

Commit 10b0f78

Browse files
nathanchanceherbertx
authored andcommitted
crypto: xor - Remove unused variable count in do_xor_speed
Clang warns: crypto/xor.c:101:4: warning: variable 'count' is uninitialized when used here [-Wuninitialized] count++; ^~~~~ crypto/xor.c:86:17: note: initialize the variable 'count' to silence this warning int i, j, count; ^ = 0 1 warning generated. After the refactoring to use ktime that happened in this function, count is only assigned, never read. Just remove the variable to get rid of the warning. Fixes: c055e3e ("crypto: xor - use ktime for template benchmarking") Link: ClangBuiltLinux#1171 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Acked-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 4f28945 commit 10b0f78

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

crypto/xor.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static void __init
8383
do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2)
8484
{
8585
int speed;
86-
int i, j, count;
86+
int i, j;
8787
ktime_t min, start, diff;
8888

8989
tmpl->next = template_list;
@@ -98,8 +98,6 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2)
9898
mb(); /* prevent loop optimzation */
9999
tmpl->do_2(BENCH_SIZE, b1, b2);
100100
mb();
101-
count++;
102-
mb();
103101
}
104102
diff = ktime_sub(ktime_get(), start);
105103
if (diff < min)

0 commit comments

Comments
 (0)