linux-next: build warning after merge of the crypto tree
Subsystems (2)
Hi Herbert,
After merging the crypto tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:
crypto/xor.c: In function 'calibrate_xor_blocks':crypto/xor.c:156:1: warning: label 'out' defined but not used [-Wunused-label]
out:
^
Introduced by commit
39457acda913 ("crypto: xor - skip speed test if the xor function is selected automatically")
This build does not have XOR_SELECT_TEMPLATE set.
Signature · 2 lines
Cheers, Stephen Rothwell
Quoted 10 lines · On Thu, 25 Aug 2016 11:38:24 +1000 Stephen Rothwell <[email protected]>…
Hi Herbert,
After merging the crypto tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:
crypto/xor.c: In function 'calibrate_xor_blocks':crypto/xor.c:156:1: warning: label 'out' defined but not used [-Wunused-label]
out:
^
Quoted 5 lines
Introduced by commit
39457acda913("crypto: xor - skip speed test if the xor function is selected automatically")This build does not have
XOR_SELECT_TEMPLATEset.
Hmm, this is probably the best option to get rid of the warning:
--
crypto/xor.c +2 -2
@@ -117,7 +117,8 @@ calibrate_xor_blocks(void)printk (KERN_INFO "xor: automatically using best " "checksumming function %-10s\n" , fastest->name); - goto out; + active_template = fastest; + return 0; }#endif
@@ -153,7 +154,6 @@ calibrate_xor_blocks(void)#undef xor_speedfree_pages ((unsigned long )b1,2 ); -out: active_template = fastest;return 0 ; }
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
Herbert Xu
maintainerQuoted 13 lines · Martin Schwidefsky
Quoted 10 lines · On Thu, 25 Aug 2016 11:38:24 +1000 Stephen Rothwell <[email protected]>…
Hi Herbert,
After merging the crypto tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:
crypto/xor.c: In function 'calibrate_xor_blocks':crypto/xor.c:156:1: warning: label 'out' defined but not used [-Wunused-label]
out:
^
Quoted 7 lines
Quoted 5 lines
Introduced by commit
39457acda913("crypto: xor - skip speed test if the xor function is selected automatically")This build does not have
XOR_SELECT_TEMPLATEset.Hmm, this is probably the best option to get rid of the warning:
I'm going to do something like this:
---8<---
This patch fixes an unused label warning triggered when the macro XOR_SELECT_TEMPLATE is not set.
crypto/xor.c +2 -1
@@ -113,13 +113,14 @@ calibrate_xor_blocks(void)#ifdef XOR_SELECT_TEMPLATE fastest =XOR_SELECT_TEMPLATE (fastest); +#endif +if (fastest) {printk (KERN_INFO "xor: automatically using best " "checksumming function %-10s\n" , fastest->name); goto out; } -#endif /* * Note: Since the memory is not actually used for _anything_ but to
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
Hi Herbert,
Quoted 18 lines · On Thu, 25 Aug 2016 15:47:01 +0800 Herbert Xu <[email protected]>…
I'm going to do something like this:
---8<---
This patch fixes an unused label warning triggered when the macroXOR_SELECT_TEMPLATEis not set.Fixes 39457acda913 ("crypto: xor - skip speed test if the xor...")Reported-by Stephen Rothwell <[email protected]>Signed-off-by Herbert Xu <[email protected]>crypto/xor.c +0
-0@@ -113,13 +113,14 @@ calibrate_xor_blocks(void)#ifdef XOR_SELECT_TEMPLATE
crypto/xor.c calibrate_xor_blocks(void) · line 122
Quoted 10 lines
crypto/xor.c +2
-1fastest =XOR_SELECT_TEMPLATE (fastest); +#endif +if (fastest) {printk (KERN_INFO "xor: automatically using best " "checksumming function %-10s\n" , fastest->name); goto out; } -#endif
That looks fine to me. An alternative might be to have:
#ifndef XOR_SELECT_TEMPLATE
#define XOR_SELECT_TEMPLATE(x) (x)
#endif
near the top of the file. That gets the #ifdef out of the code flow and serves as some hint that such a thing can be defined by arch header files.
Either way.
Signature · 2 lines
Cheers, Stephen Rothwell
Herbert Xu
maintainercrypto: xor - Fix warning when XOR_SELECT_TEMPLATE is unset
Quoted 10 lines · Stephen Rothwell
That looks fine to me. An alternative might be to have:
#ifndef
XOR_SELECT_TEMPLATE
#defineXOR_SELECT_TEMPLATE(x)(x)
#endifnear the top of the file. That gets the #ifdef out of the code flow and serves as some hint that such a thing can be defined by arch header files.
Good idea. Thanks Stephen.
---8<---
This patch fixes an unused label warning triggered when the macro XOR_SELECT_TEMPLATE is not set.
crypto/xor.c +5 -4
@@ -24,6 +24,10 @@#include <linux/preempt.h> #include <asm/xor.h> +#ifndef XOR_SELECT_TEMPLATE +#define XOR_SELECT_TEMPLATE (x) (x) +#endif +/* The xor routines to use. */ static struct xor_block_template *active_template;
@@ -109,17 +113,14 @@ calibrate_xor_blocks(void)void *b1, *b2;struct xor_block_template *f, *fastest; - fastest =NULL ; + fastest =XOR_SELECT_TEMPLATE (NULL ); -#ifdef XOR_SELECT_TEMPLATE - fastest =XOR_SELECT_TEMPLATE (fastest);if (fastest) {printk (KERN_INFO "xor: automatically using best " "checksumming function %-10s\n" , fastest->name); goto out; } -#endif /* * Note: Since the memory is not actually used for _anything_ but to
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