From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932667AbcHYLP1 (ORCPT ); Thu, 25 Aug 2016 07:15:27 -0400 Received: from ozlabs.org ([103.22.144.67]:53350 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756114AbcHYLPW (ORCPT ); Thu, 25 Aug 2016 07:15:22 -0400 Date: Thu, 25 Aug 2016 21:14:11 +1000 From: Stephen Rothwell To: Herbert Xu Cc: Martin Schwidefsky , linux-next@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: linux-next: build warning after merge of the crypto tree Message-ID: <20160825211411.08858397@canb.auug.org.au> In-Reply-To: <20160825074701.GA11175@gondor.apana.org.au> References: <20160825113824.61ca7364@canb.auug.org.au> <20160825082010.5523ae6f@mschwide> <20160825074701.GA11175@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Herbert, On Thu, 25 Aug 2016 15:47:01 +0800 Herbert Xu 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 > Signed-off-by: Herbert Xu > > 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