From patchwork Thu Oct 22 06:51:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 7462751 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5BEE49F1C3 for ; Thu, 22 Oct 2015 06:52:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E2EF2094F for ; Thu, 22 Oct 2015 06:52:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80A022094E for ; Thu, 22 Oct 2015 06:52:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756782AbbJVGwB (ORCPT ); Thu, 22 Oct 2015 02:52:01 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:35565 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751544AbbJVGv7 (ORCPT ); Thu, 22 Oct 2015 02:51:59 -0400 Received: by wicll6 with SMTP id ll6so121096910wic.0; Wed, 21 Oct 2015 23:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iGjJvWuFVGcRYGXCG+zgQS3URopn4wHNL0QE830yqaY=; b=n3Iv78iqtim39VCr24sElBGqoC4N+2Yw4RKy0laiBPamSthh0IBH0wjF4KJRBH8lGw 7TtUhR6p8RRuWDa5vp4VNbciKBZX4Udwp1/fGTuYMvwhdWjrAT+E1L3E5k3FSkP62VFW rBPr22wZx56jEQk/wPnITnxq554DXGTLbVBImcxDRf67oM/z46YqEP7vxvDIiEE504A8 mw7HOiBYObEDUrPSdODX52ebvmzczyLvju3dJTStcQVdJ2MZsOftwv2zrFq3iveINhOl nEZqvWXqwp8JXwcDNW//+jOmhzdC4N2dKzcdhXU0vKLoB6EQ+ZErTfasi1XNgLid0Pbh mDog== X-Received: by 10.194.205.131 with SMTP id lg3mr15299433wjc.20.1445496718078; Wed, 21 Oct 2015 23:51:58 -0700 (PDT) Received: from Red.local (ANice-651-1-260-13.w86-205.abo.wanadoo.fr. [86.205.164.13]) by smtp.googlemail.com with ESMTPSA id ka10sm14906344wjc.30.2015.10.21.23.51.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Oct 2015 23:51:57 -0700 (PDT) From: LABBE Corentin To: davem@davemloft.net, herbert@gondor.apana.org.au Cc: LABBE Corentin , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] crypto: hifn_795x: remove the hifn_test function Date: Thu, 22 Oct 2015 08:51:50 +0200 Message-Id: <1445496712-5654-2-git-send-email-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1445496712-5654-1-git-send-email-clabbe.montjoie@gmail.com> References: <1445496712-5654-1-git-send-email-clabbe.montjoie@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The hifn_test function is redundant with test done at register time by the crypto API, so remove it. Signed-off-by: LABBE Corentin --- drivers/crypto/hifn_795x.c | 58 ---------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index 079b995..e6bc825 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c @@ -1650,60 +1650,6 @@ err_out_exit: return err; } -static int hifn_test(struct hifn_device *dev, int encdec, u8 snum) -{ - int n, err; - u8 src[16]; - struct hifn_context ctx; - struct hifn_request_context rctx; - u8 fips_aes_ecb_from_zero[16] = { - 0x66, 0xE9, 0x4B, 0xD4, - 0xEF, 0x8A, 0x2C, 0x3B, - 0x88, 0x4C, 0xFA, 0x59, - 0xCA, 0x34, 0x2B, 0x2E}; - struct scatterlist sg; - - memset(src, 0, sizeof(src)); - memset(ctx.key, 0, sizeof(ctx.key)); - - ctx.dev = dev; - ctx.keysize = 16; - rctx.ivsize = 0; - rctx.iv = NULL; - rctx.op = (encdec)?ACRYPTO_OP_ENCRYPT:ACRYPTO_OP_DECRYPT; - rctx.mode = ACRYPTO_MODE_ECB; - rctx.type = ACRYPTO_TYPE_AES_128; - rctx.walk.cache[0].length = 0; - - sg_init_one(&sg, &src, sizeof(src)); - - err = hifn_setup_dma(dev, &ctx, &rctx, &sg, &sg, sizeof(src), NULL); - if (err) - goto err_out; - - dev->started = 0; - msleep(200); - - dprintk("%s: decoded: ", dev->name); - for (n=0; nname); - for (n=0; nname); - return 0; - } - -err_out: - printk(KERN_INFO "%s: AES 128 ECB test has been failed.\n", dev->name); - return -1; -} - static int hifn_start_device(struct hifn_device *dev) { int err; @@ -2658,10 +2604,6 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (err) goto err_out_free_irq; - err = hifn_test(dev, 1, 0); - if (err) - goto err_out_stop_device; - err = hifn_register_rng(dev); if (err) goto err_out_stop_device;