From: Stephen Rothwell <hidden> Date: 2016-08-25 05:18:00
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.
--
Cheers,
Stephen Rothwell
From: Herbert Xu <herbert@gondor.apana.org.au> Date: 2016-08-25 08:35:37
On Thu, Aug 25, 2016 at 08:20:10AM +0200, Martin Schwidefsky wrote:
On Thu, 25 Aug 2016 11:38:24 +1000
Stephen Rothwell [off-list ref] wrote:
quoted
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.
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.
Fixes: 39457acda913 ("crypto: xor - skip speed test if the xor...")
Reported-by: Stephen Rothwell <redacted>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
@@ -113,13 +113,14 @@ calibrate_xor_blocks(void)#ifdef XOR_SELECT_TEMPLATEfastest=XOR_SELECT_TEMPLATE(fastest);+#endif+if(fastest){printk(KERN_INFO"xor: automatically using best ""checksumming function %-10s\n",fastest->name);gotoout;}-#endif/**Note:Sincethememoryisnotactuallyusedfor_anything_butto
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
From: Martin Schwidefsky <hidden> Date: 2016-08-25 09:23:13
On Thu, 25 Aug 2016 11:38:24 +1000
Stephen Rothwell [off-list ref] wrote:
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.
Hmm, this is probably the best option to get rid of the warning:
--
@@ -117,7 +117,8 @@ calibrate_xor_blocks(void)printk(KERN_INFO"xor: automatically using best ""checksumming function %-10s\n",fastest->name);-gotoout;+active_template=fastest;+return0;}#endif
From: Stephen Rothwell <hidden> Date: 2016-08-25 11:15:27
Hi Herbert,
On Thu, 25 Aug 2016 15:47:01 +0800 Herbert Xu [off-list ref] wrote:
quoted hunk
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.
Fixes: 39457acda913 ("crypto: xor - skip speed test if the xor...")
Reported-by: Stephen Rothwell <redacted>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
@@ -113,13 +113,14 @@ calibrate_xor_blocks(void)#ifdef XOR_SELECT_TEMPLATEfastest=XOR_SELECT_TEMPLATE(fastest);+#endif+if(fastest){printk(KERN_INFO"xor: automatically using best ""checksumming function %-10s\n",fastest->name);gotoout;}-#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.
--
Cheers,
Stephen Rothwell
From: Herbert Xu <herbert@gondor.apana.org.au> Date: 2016-08-26 15:21:25
On Thu, Aug 25, 2016 at 09:14:11PM +1000, Stephen Rothwell wrote:
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.
Good idea. Thanks Stephen.
---8<---
This patch fixes an unused label warning triggered when the macro
XOR_SELECT_TEMPLATE is not set.
Fixes: 39457acda913 ("crypto: xor - skip speed test if the xor...")
Reported-by: Stephen Rothwell <redacted>
Suggested-by: Stephen Rothwell <redacted>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
@@ -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. */staticstructxor_block_template*active_template;
@@ -109,17 +113,14 @@ calibrate_xor_blocks(void)void*b1,*b2;structxor_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);gotoout;}-#endif/**Note:Sincethememoryisnotactuallyusedfor_anything_butto
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt