Received: by 10.223.176.46 with SMTP id f43csp36309wra; Thu, 18 Jan 2018 13:33:22 -0800 (PST) X-Google-Smtp-Source: ACJfBotv4VUlk7MHaTJl1nBefJElCpGBOeeeOCJUSzC67iB96G9iL9hEDCeqgzLPBa4APYPd+Iqg X-Received: by 10.101.81.7 with SMTP id f7mr39065261pgq.447.1516311201920; Thu, 18 Jan 2018 13:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516311201; cv=none; d=google.com; s=arc-20160816; b=kqd1mUOvsGN3Ati7sHD8rIEImpgi+oA8/3EILGXgkmgIzYR65/xkTAC4cKoyhfMnMd K00YWUtJQ09sYyYdy1Rq92o9ttndind8ShuiEp71MH3nQfbO1DM+DWCG1wbAY4uwK7Ns SdZnxJEWytj3UPWJCBwpd+HnP1lj/ZHWgLGpjFVJ+06KxXol89J80p1FtpA40JVgM350 W9MmbxXq1M30/xjvET8pEC1h+xxLgLNMJGut+Ia9NNsQzm9PaTVg678u+oAWpR4eQqIr l/1RxXNF+gUeodBhqHsw6Qf6NizHjwSj+cCrIt6GgIe6xZUHCvEv0aGT5C1c2ytdarO3 4fog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=jgl3UZLv/ff0OcMtFeQVpQTVfq/mGwiWQSdNtzjrQ3g=; b=03R94bKiHppXmR4OI2wQ2Z77RorM7bCPahRVgyS7bneFyaOzNGMx9IwsCoZ/FimIMp fcJnt6aCD20pme9JaJqTK9NWICHYi7MYgQ2b/BKm9koGWGVmCKyVQd9MQq4FCRyoXbGG llEiXTaEVTJ0MgP0iRvMopaRMYDw8Rv+AiGEDUrekYNErNwPuaosAGBsCcFFOX/lMJtI 2QRpDPgEwyTCmdueU46cTi6m3fNUtdHWBzPM2lMmC8rnQuKN2qWtWCEMIzCp47IGtA8+ reCv9QZm81u2oANzJzn8+1PouOVh2W7a74QtXaKu/BYIH+eSYMdCC0QcpBqPSO3mHOKF fOuA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e22si7457998pff.210.2018.01.18.13.33.08; Thu, 18 Jan 2018 13:33:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755334AbeARVcS (ORCPT + 99 others); Thu, 18 Jan 2018 16:32:18 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:50746 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754809AbeARVcG (ORCPT ); Thu, 18 Jan 2018 16:32:06 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3zMxxF2XtTz1r2R7; Thu, 18 Jan 2018 22:32:01 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3zMxxF0b60z1qqkR; Thu, 18 Jan 2018 22:32:01 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id i0W3aSP4fcju; Thu, 18 Jan 2018 22:31:59 +0100 (CET) X-Auth-Info: GlWYYrEXHo3VluicAXwAatVXVZmpRmcCA/9Z0iWZBUY= Received: from [IPv6:::1] (unknown [195.140.253.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 18 Jan 2018 22:31:59 +0100 (CET) Subject: Re: [PATCH 5/5] crypto: ahash.c: Require export/import in ahash To: Kamil Konieczny , linux-crypto@vger.kernel.org Cc: "David S. Miller" , Bartlomiej Zolnierkiewicz , Sonic Zhang , Fabio Estevam , Shawn Guo , Tom Lendacky , Jan Engelhardt , Arvind Yadav , Linus Walleij , Joakim Bech , linux-kernel@vger.kernel.org, Herbert Xu References: <20180118183404.12583-1-k.konieczny@partner.samsung.com> <20180118183404.12583-6-k.konieczny@partner.samsung.com> From: Marek Vasut Message-ID: <5db6f843-cc51-09f2-f388-8dade440c6bc@denx.de> Date: Thu, 18 Jan 2018 22:31:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180118183404.12583-6-k.konieczny@partner.samsung.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/18/2018 07:34 PM, Kamil Konieczny wrote: > Export and import are mandatory in async hash. As drivers were > rewritten, drop empty wrappers and correct init of ahash transformation. Are you moving checks from the core subsystem to drivers ? This looks really nonsensical and the commit message doesn't explain the rationale for that at all. > Signed-off-by: Kamil Konieczny > --- > crypto/ahash.c | 18 ++---------------- > 1 file changed, 2 insertions(+), 16 deletions(-) > > diff --git a/crypto/ahash.c b/crypto/ahash.c > index 3a35d67de7d9..c3cce508c1d4 100644 > --- a/crypto/ahash.c > +++ b/crypto/ahash.c > @@ -434,16 +434,6 @@ static int ahash_def_finup(struct ahash_request *req) > return ahash_def_finup_finish1(req, err); > } > > -static int ahash_no_export(struct ahash_request *req, void *out) > -{ > - return -ENOSYS; > -} > - > -static int ahash_no_import(struct ahash_request *req, const void *in) > -{ > - return -ENOSYS; > -} > - > static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) > { > struct crypto_ahash *hash = __crypto_ahash_cast(tfm); > @@ -451,8 +441,6 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) > > hash->setkey = ahash_nosetkey; > hash->has_setkey = false; > - hash->export = ahash_no_export; > - hash->import = ahash_no_import; > > if (tfm->__crt_alg->cra_type != &crypto_ahash_type) > return crypto_init_shash_ops_async(tfm); > @@ -462,15 +450,13 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) > hash->final = alg->final; > hash->finup = alg->finup ?: ahash_def_finup; > hash->digest = alg->digest; > + hash->export = alg->export; > + hash->import = alg->import; > > if (alg->setkey) { > hash->setkey = alg->setkey; > hash->has_setkey = true; > } > - if (alg->export) > - hash->export = alg->export; > - if (alg->import) > - hash->import = alg->import; > > return 0; > } > -- Best regards, Marek Vasut