Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2643833imu; Thu, 17 Jan 2019 18:59:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Godu9glXfN1LCeu1EYwu+XSHZUiCpR/4klvLYeGAEygW75disiy+KZmI1GHoPAVoqxdPk X-Received: by 2002:a63:3602:: with SMTP id d2mr15660245pga.404.1547780380309; Thu, 17 Jan 2019 18:59:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547780380; cv=none; d=google.com; s=arc-20160816; b=mSUpiyu5bnyQLmWSTNxFTH/ac3Lfn0toCP/71YnQ9BFUglp0wRrUvAFJ1Krabk8bb/ 7mSudvPX7S/jMek3xUfrCjujzSvNThODuRK+eQpfWjfdV9DQbBnW4nF58+jtJzXY0MTp oUPxLnhkwa+hjFQ0wEneoxwFjHX3HKP1XBQuj+PxfO1mqG0zQVqP9ANs0Lma2DGBfb5U FYIvx68ednR/24U3a+qP9wFqmblD9BfE4qa7p+gP74a2PhgHx6ChlpfSHlxm2hJuAc73 diO0m10NFP3sZCUYiaSKujKutQx+VKTvb0PupThbXY3NddQekn8NRfBZj4feGnyhoQFQ KFkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RFmTl03dYGXxTYzxJ1kviEAeM2jjA+qJazqXErMUqmA=; b=Kc6R5vMIroiMB9CFCtEyvi38zSi4+/jcvS8rUYS+qFjVn/Hce4MUqpQ/c9pNAU8tjL t7rTzXYdRP0P2odmg8xKzJBVeeAbiDBvsw8PojReYiB65jlyQzmt1/2JgJAKvnx3//cp uHw6yKwzlNxjXLV4WK2F5wWta4ur8j2pMB69TssamGuuTzPJiy3SWNbQxTcUNHbaChpL ghJKroqHclbhywO+nIij+uOAHaL3zsY1A5biTKHB6lzc6NG2J7zZXq+ZNjYKIZ6UA5gV NJtFMY/uc1UsDUi37EL8i0Vmx9Eef1/oVdFlUdjoR/KQ7Kz+KYAyX7M5i4Spe2rwDrZG +4qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0HMF2bYQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d189si3269896pgc.393.2019.01.17.18.59.24; Thu, 17 Jan 2019 18:59:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0HMF2bYQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbfARC6E (ORCPT + 99 others); Thu, 17 Jan 2019 21:58:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:34072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726834AbfARC6D (ORCPT ); Thu, 17 Jan 2019 21:58:03 -0500 Received: from sol.localdomain (c-24-23-143-129.hsd1.ca.comcast.net [24.23.143.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1D4AC20873; Fri, 18 Jan 2019 02:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547780283; bh=sEfR3ok3RYwVP6HM0cIrTT7/A5Sy8ExwvvafJSQ/sgc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0HMF2bYQ241btn0PHaEggxr8xcHiYsSf8qbrxK7Fxqr4+VuzVqiqR2xNdLehFkKUz i8vwnMvF8fCMUppihukvcV1bJeiO+8lqFPILNdNXzvQRR+E1oLxGRW/XoMGLioqwuP CMUp7FE3bXGzN3q58fCcJlp79yPh2gWUF7gz/6Yw= Date: Thu, 17 Jan 2019 18:58:01 -0800 From: Eric Biggers To: Xiongfeng Wang Cc: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, broonie@kernel.org, ard.biesheuvel@linaro.org, jonathan.cameron@huawei.com Subject: Re: [PATCH V2 4/5] crypto: ctr - use template array registering API to simplify the code Message-ID: <20190118025800.GB737@sol.localdomain> References: <1547707683-45878-1-git-send-email-wangxiongfeng2@huawei.com> <1547707683-45878-5-git-send-email-wangxiongfeng2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1547707683-45878-5-git-send-email-wangxiongfeng2@huawei.com> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 17, 2019 at 02:48:02PM +0800, Xiongfeng Wang wrote: > Use crypto template array registering API to simplify the code. > > Signed-off-by: Xiongfeng Wang > --- > crypto/ctr.c | 43 +++++++++++++++---------------------------- > 1 file changed, 15 insertions(+), 28 deletions(-) > > diff --git a/crypto/ctr.c b/crypto/ctr.c > index 4c743a9..d9f9d65 100644 > --- a/crypto/ctr.c > +++ b/crypto/ctr.c > @@ -171,12 +171,6 @@ static int crypto_ctr_create(struct crypto_template *tmpl, struct rtattr **tb) > return err; > } > > -static struct crypto_template crypto_ctr_tmpl = { > - .name = "ctr", > - .create = crypto_ctr_create, > - .module = THIS_MODULE, > -}; > - > static int crypto_rfc3686_setkey(struct crypto_skcipher *parent, > const u8 *key, unsigned int keylen) > { > @@ -366,36 +360,29 @@ static int crypto_rfc3686_create(struct crypto_template *tmpl, > goto out; > } > > -static struct crypto_template crypto_rfc3686_tmpl = { > - .name = "rfc3686", > - .create = crypto_rfc3686_create, > - .module = THIS_MODULE, > +static struct crypto_template crypto_ctr_tmpls[] = { > + { > + .name = "ctr", > + .create = crypto_ctr_create, > + .module = THIS_MODULE, > + }, { > + .name = "rfc3686", > + .create = crypto_rfc3686_create, > + .module = THIS_MODULE, > + }, > }; > > + If you resend please also remove the extra blank line here. - Eric