crypto: xor - Remove unused variable count in do_xor_speed
PATCH 1/1 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;
^
= 01 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.
--- crypto/xor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
crypto/xor.c +1 -3
@@ -83,7 +83,7 @@ static void __init do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) { int speed; -int i, j, count; +int i, j;ktime_t min, start, diff; tmpl->next = template_list;
@@ -98,8 +98,6 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2)mb ();/* prevent loop optimzation */ tmpl->do_2 (BENCH_SIZE , b1, b2);mb (); - count++; -mb (); } diff =ktime_sub (ktime_get (), start);if (diff < min)
base-commit: ed4424f2fb02497b0ea92bf58c533c598c0da1d3
Signature · 1 line
2.29.0.rc0
Hi,
Quoted 18 lines · Nathan Chancellor
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; ^ = 01 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.
Quoted 6 lines
Fixes c055e3eae0f1 ("crypto: xor - use ktime for template benchmarking")Signed-off-by Nathan Chancellor <[email protected]>--- crypto/xor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Whoops! Sorry for missing this in my review.
Quoted 14 lines · Nathan Chancellor
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; ^ = 01 warning generated.
Quoted 7 lines
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 c055e3eae0f1 ("crypto: xor - use ktime for template benchmarking")Signed-off-by Nathan Chancellor <[email protected]>
Quoted 31 lines
--- crypto/xor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)crypto/xor.c +1
-3@@ -83,7 +83,7 @@ static void __init do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) { int speed; -int i, j, count; +int i, j;ktime_t min, start, diff; tmpl->next = template_list;@@ -98,8 +98,6 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2)mb ();/* prevent loop optimzation */ tmpl->do_2 (BENCH_SIZE , b1, b2);mb (); - count++; -mb (); } diff =ktime_sub (ktime_get (), start);if (diff < min)base-commit:
ed4424f2fb02497b0ea92bf58c533c598c0da1d3--
2.29.0.rc0
Herbert Xu
maintainerQuoted 17 lines · Nathan Chancellor
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; ^ = 01 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.
Quoted 6 lines
Fixes c055e3eae0f1 ("crypto: xor - use ktime for template benchmarking")Signed-off-by Nathan Chancellor <[email protected]>--- crypto/xor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt