Thread (5 messages) 5 messages, 3 authors, 2016-08-26

Re: linux-next: build warning after merge of the crypto tree

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2016-08-25 08:35:37
Also in: lkml
Subsystem: crypto api, the rest · Maintainers: Herbert Xu, "David S. Miller", Linus Torvalds

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>
diff --git a/crypto/xor.c b/crypto/xor.c
index b8975d9..69866e9 100644
--- a/crypto/xor.c
+++ b/crypto/xor.c
@@ -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
-- 
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help