lkml.org 
[lkml]   [2016]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux-next: build warning after merge of the crypto tree
Hi Herbert,

On Thu, 25 Aug 2016 15:47:01 +0800 Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> 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 <sfr@canb.auug.org.au>
> 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

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

\
 
 \ /
  Last update: 2016-09-17 09:57    [W:0.067 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site