From patchwork Tue Jun 27 07:27:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 106389 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp906662qge; Tue, 27 Jun 2017 00:28:14 -0700 (PDT) X-Received: by 10.99.145.67 with SMTP id l64mr3928321pge.184.1498548494545; Tue, 27 Jun 2017 00:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498548494; cv=none; d=google.com; s=arc-20160816; b=suHKo7CiSb+FUOrhqJ6+tYj90kHX5u4MdzImU3WvkBuAtm+0GzsLv4ZmOWazQdRz7y HXr/BO5dTZXTb6lM0NcyuEZHTFXG+BD6BXtWs/XlmsHa9e3yXvFeDWKy1IiTyexxBMgI Es5KvN88G3YSOtDVKgJeMxUr+aQyFPvcELJr48v+Sz1JS1crGQ3esoOVHygS3y2gHkFO O6c9GccwsO0s/uEDnduM2kJKGWmeIwieUYH1iYdmO3iwmjdvtxdihL2+3UMSBNX+j/hN swQhZaFnGe1JcyI6th/fxcdTEkbm82YyReWLgxx3muCRibfVfoSBqf27VPUnZXHbYV/o 1nDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=PKHLCcTeYyOkDQXfoYErvzK/t0734hG98UjXVoUAtM0=; b=Xxb06dY8z3cDJl5RC9l9KDyJnxrlvzn92+0Oryoq3kkPEYF/FpA3iOdf49ZeIG05Tr 2Z5YDFm/NdXvMU/HWeTl1NvvkE82WWJ8DYlU0I30vs5ISAyUufP9nCq3Z+9pVzpwbcyM y4HFbIe3RorM69K53b2TBMjntwc1vHcPZ6lvGCyq4nc36FM2C4j9SXCdMsyqk7Mz5rLq pfXkGJKkAA/6hPyGNFYNXgCBKgD1HPw+St/MEwoVvXU/oOGeSv6+yNj+eoTSQmKK6M6S WQKnTa2O183SiHr2W2bxgiSBvqwomc1D4+tmGf4En/GdmeLnE7MiKVF8EUx6dRTUlaPV ocNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 r10si1440045pfg.199.2017.06.27.00.28.14; Tue, 27 Jun 2017 00:28:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752377AbdF0H2G (ORCPT + 1 other); Tue, 27 Jun 2017 03:28:06 -0400 Received: from foss.arm.com ([217.140.101.70]:52414 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752362AbdF0H16 (ORCPT ); Tue, 27 Jun 2017 03:27:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 684D3344; Tue, 27 Jun 2017 00:27:48 -0700 (PDT) Received: from gby.kfn.arm.com (unknown [10.45.48.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 380DB3F4FF; Tue, 27 Jun 2017 00:27:46 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ofir Drang Subject: [PATCH 02/14] staging: ccree: drop comparsion to true/false Date: Tue, 27 Jun 2017 10:27:14 +0300 Message-Id: <1498548449-10803-3-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498548449-10803-1-git-send-email-gilad@benyossef.com> References: <1498548449-10803-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fix cases in ccree where explicit comparsion to true/false was made. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 18 +++++++++--------- drivers/staging/ccree/ssi_buffer_mgr.c | 20 ++++++++++---------- drivers/staging/ccree/ssi_cipher.c | 2 +- drivers/staging/ccree/ssi_driver.c | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index 2e8dc3f..00375b6 100644 --- a/drivers/staging/ccree/ssi_aead.c +++ b/drivers/staging/ccree/ssi_aead.c @@ -236,7 +236,7 @@ static void ssi_aead_complete(struct device *dev, void *ssi_req, void __iomem *c err = -EBADMSG; } } else { /*ENCRYPT*/ - if (unlikely(areq_ctx->is_icv_fragmented == true)) + if (unlikely(areq_ctx->is_icv_fragmented)) ssi_buffer_mgr_copy_scatterlist_portion( areq_ctx->mac_buf, areq_ctx->dstSgl, areq->cryptlen + areq_ctx->dstOffset, areq->cryptlen + areq_ctx->dstOffset + ctx->authsize, SSI_SG_FROM_BUF); @@ -790,7 +790,7 @@ ssi_aead_process_authenc_data_desc( ssi_sram_addr_t mlli_addr = areq_ctx->assoc.sram_addr; u32 mlli_nents = areq_ctx->assoc.mlli_nents; - if (likely(areq_ctx->is_single_pass == true)) { + if (likely(areq_ctx->is_single_pass)) { if (direct == DRV_CRYPTO_DIRECTION_ENCRYPT) { mlli_addr = areq_ctx->dst.sram_addr; mlli_nents = areq_ctx->dst.mlli_nents; @@ -1173,7 +1173,7 @@ static inline void ssi_aead_load_mlli_to_sram( if (unlikely( (req_ctx->assoc_buff_type == SSI_DMA_BUF_MLLI) || (req_ctx->data_buff_type == SSI_DMA_BUF_MLLI) || - (req_ctx->is_single_pass == false))) { + !req_ctx->is_single_pass)) { SSI_LOG_DEBUG("Copy-to-sram: mlli_dma=%08x, mlli_size=%u\n", (unsigned int)ctx->drvdata->mlli_sram_addr, req_ctx->mlli_params.mlli_len); @@ -1228,7 +1228,7 @@ static inline void ssi_aead_hmac_authenc( unsigned int data_flow_mode = ssi_aead_get_data_flow_mode( direct, ctx->flow_mode, req_ctx->is_single_pass); - if (req_ctx->is_single_pass == true) { + if (req_ctx->is_single_pass) { /** * Single-pass flow */ @@ -1282,7 +1282,7 @@ ssi_aead_xcbc_authenc( unsigned int data_flow_mode = ssi_aead_get_data_flow_mode( direct, ctx->flow_mode, req_ctx->is_single_pass); - if (req_ctx->is_single_pass == true) { + if (req_ctx->is_single_pass) { /** * Single-pass flow */ @@ -1341,7 +1341,7 @@ static int validate_data_size(struct ssi_aead_ctx *ctx, if (ctx->cipher_mode == DRV_CIPHER_CCM) break; if (ctx->cipher_mode == DRV_CIPHER_GCTR) { - if (areq_ctx->plaintext_authenticate_only == true) + if (areq_ctx->plaintext_authenticate_only) areq_ctx->is_single_pass = false; break; } @@ -1715,7 +1715,7 @@ static inline void ssi_aead_gcm_setup_gctr_desc( set_flow_mode(&desc[idx], S_DIN_to_AES); idx++; - if ((req_ctx->cryptlen != 0) && (req_ctx->plaintext_authenticate_only == false)) { + if ((req_ctx->cryptlen != 0) && (!req_ctx->plaintext_authenticate_only)) { /* load AES/CTR initial CTR value inc by 2*/ hw_desc_init(&desc[idx]); set_cipher_mode(&desc[idx], DRV_CIPHER_GCTR); @@ -1815,7 +1815,7 @@ static inline int ssi_aead_gcm( //in RFC4543 no data to encrypt. just copy data from src to dest. - if (req_ctx->plaintext_authenticate_only == true) { + if (req_ctx->plaintext_authenticate_only) { ssi_aead_process_cipher_data_desc(req, BYPASS, desc, seq_size); ssi_aead_gcm_setup_ghash_desc(req, desc, seq_size); /* process(ghash) assoc data */ @@ -1913,7 +1913,7 @@ static int config_gcm_context(struct aead_request *req) memcpy(req_ctx->gcm_iv_inc1, req->iv, 16); - if (req_ctx->plaintext_authenticate_only == false) { + if (!req_ctx->plaintext_authenticate_only) { __be64 temp64; temp64 = cpu_to_be64(req->assoclen * 8); memcpy(&req_ctx->gcm_len_block.lenA, &temp64, sizeof(temp64)); diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index 00d95c1..5c46145 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.c +++ b/drivers/staging/ccree/ssi_buffer_mgr.c @@ -798,7 +798,7 @@ static inline int ssi_buffer_mgr_aead_chain_iv( SSI_LOG_DEBUG("Mapped iv %u B at va=%pK to dma=0x%llX\n", hw_iv_size, req->iv, (unsigned long long)areq_ctx->gen_ctx.iv_dma_addr); - if (do_chain == true && areq_ctx->plaintext_authenticate_only == true) { // TODO: what about CTR?? ask Ron + if (do_chain && areq_ctx->plaintext_authenticate_only) { // TODO: what about CTR?? ask Ron struct crypto_aead *tfm = crypto_aead_reqtfm(req); unsigned int iv_size_to_authenc = crypto_aead_ivsize(tfm); unsigned int iv_ofs = GCM_BLOCK_RFC4_IV_OFFSET; @@ -894,7 +894,7 @@ static inline int ssi_buffer_mgr_aead_chain_assoc( else areq_ctx->assoc_buff_type = SSI_DMA_BUF_MLLI; - if (unlikely((do_chain == true) || + if (unlikely((do_chain) || (areq_ctx->assoc_buff_type == SSI_DMA_BUF_MLLI))) { SSI_LOG_DEBUG("Chain assoc: buff_type=%s nents=%u\n", @@ -975,7 +975,7 @@ static inline int ssi_buffer_mgr_prepare_aead_data_mlli( goto prepare_data_mlli_exit; } - if (unlikely(areq_ctx->is_icv_fragmented == true)) { + if (unlikely(areq_ctx->is_icv_fragmented)) { /* Backup happens only when ICV is fragmented, ICV * verification is made by CPU compare in order to simplify * MAC verification upon request completion @@ -1033,7 +1033,7 @@ static inline int ssi_buffer_mgr_prepare_aead_data_mlli( goto prepare_data_mlli_exit; } - if (unlikely(areq_ctx->is_icv_fragmented == true)) { + if (unlikely(areq_ctx->is_icv_fragmented)) { /* Backup happens only when ICV is fragmented, ICV * verification is made by CPU compare in order to simplify * MAC verification upon request completion @@ -1076,7 +1076,7 @@ static inline int ssi_buffer_mgr_prepare_aead_data_mlli( goto prepare_data_mlli_exit; } - if (likely(areq_ctx->is_icv_fragmented == false)) { + if (likely(!areq_ctx->is_icv_fragmented)) { /* Contig. ICV */ areq_ctx->icv_dma_addr = sg_dma_address( &areq_ctx->dstSgl[areq_ctx->dst.nents - 1]) + @@ -1200,7 +1200,7 @@ static inline int ssi_buffer_mgr_aead_chain_data( areq_ctx->dstOffset = offset; if ((src_mapped_nents > 1) || (dst_mapped_nents > 1) || - (do_chain == true)) { + do_chain) { areq_ctx->data_buff_type = SSI_DMA_BUF_MLLI; rc = ssi_buffer_mgr_prepare_aead_data_mlli(drvdata, req, sg_data, &src_last_bytes, &dst_last_bytes, is_last_table); @@ -1233,7 +1233,7 @@ static void ssi_buffer_mgr_update_aead_mlli_nents(struct ssi_drvdata *drvdata, areq_ctx->src.sram_addr = drvdata->mlli_sram_addr + curr_mlli_size; areq_ctx->dst.sram_addr = areq_ctx->src.sram_addr; - if (areq_ctx->is_single_pass == false) + if (!areq_ctx->is_single_pass) areq_ctx->assoc.mlli_nents += areq_ctx->src.mlli_nents; } else { @@ -1246,7 +1246,7 @@ static void ssi_buffer_mgr_update_aead_mlli_nents(struct ssi_drvdata *drvdata, areq_ctx->src.sram_addr + areq_ctx->src.mlli_nents * LLI_ENTRY_BYTE_SIZE; - if (areq_ctx->is_single_pass == false) + if (!areq_ctx->is_single_pass) areq_ctx->assoc.mlli_nents += areq_ctx->src.mlli_nents; } else { @@ -1257,7 +1257,7 @@ static void ssi_buffer_mgr_update_aead_mlli_nents(struct ssi_drvdata *drvdata, areq_ctx->dst.sram_addr + areq_ctx->dst.mlli_nents * LLI_ENTRY_BYTE_SIZE; - if (areq_ctx->is_single_pass == false) + if (!areq_ctx->is_single_pass) areq_ctx->assoc.mlli_nents += areq_ctx->dst.mlli_nents; } @@ -1399,7 +1399,7 @@ int ssi_buffer_mgr_map_aead_request( goto aead_map_failure; } - if (likely(areq_ctx->is_single_pass == true)) { + if (likely(areq_ctx->is_single_pass)) { /* * Create MLLI table for: * (1) Assoc. data diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c index 519e04e..1dab3e6 100644 --- a/drivers/staging/ccree/ssi_cipher.c +++ b/drivers/staging/ccree/ssi_cipher.c @@ -839,7 +839,7 @@ static int ssi_blkcipher_process( desc, &seq_len); /* do we need to generate IV? */ - if (req_ctx->is_giv == true) { + if (req_ctx->is_giv) { ssi_req.ivgen_dma_addr[0] = req_ctx->gen_ctx.iv_dma_addr; ssi_req.ivgen_dma_addr_len = 1; /* set the IV size (8/16 B long)*/ diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging/ccree/ssi_driver.c index 7c94354..05930e8 100644 --- a/drivers/staging/ccree/ssi_driver.c +++ b/drivers/staging/ccree/ssi_driver.c @@ -205,13 +205,13 @@ int init_cc_regs(struct ssi_drvdata *drvdata, bool is_probe) cache_params = (drvdata->coherent ? CC_COHERENT_CACHE_PARAMS : 0x0); val = CC_HAL_READ_REGISTER(CC_REG_OFFSET(CRY_KERNEL, AXIM_CACHE_PARAMS)); - if (is_probe == true) { + if (is_probe) { SSI_LOG_INFO("Cache params previous: 0x%08X\n", val); } CC_HAL_WRITE_REGISTER(CC_REG_OFFSET(CRY_KERNEL, AXIM_CACHE_PARAMS), cache_params); val = CC_HAL_READ_REGISTER(CC_REG_OFFSET(CRY_KERNEL, AXIM_CACHE_PARAMS)); - if (is_probe == true) { + if (is_probe) { SSI_LOG_INFO("Cache params current: 0x%08X (expect: 0x%08X)\n", val, cache_params); } From patchwork Tue Jun 27 07:27:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 106390 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp906664qge; Tue, 27 Jun 2017 00:28:14 -0700 (PDT) X-Received: by 10.101.70.12 with SMTP id v12mr3897811pgq.160.1498548494842; Tue, 27 Jun 2017 00:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498548494; cv=none; d=google.com; s=arc-20160816; b=SLCV5EgR/aJk8qm+KDyedkQvxU7nlbE8hsnitBx3/Dc5YINO5eq+z6JF1PJ4XQJw+Q +YfegXEWlr4buxNq8XroROmeu58qoZU+yiAVAiDI0aXfD4kDhSM9gTl1lRcYSDIu6B/U fjuPoGoKnXz0so5k3fmR17/eOEvX2njp0K8udukXFokYCZeVt4VF/iWTPlSy8MOB/85x gD1vNyT1ANd1kR1bT8NgvnOuTVFrIqYGEc6JQX/oRlmvsWDsmewpL4CdgcSK5TtjCG/V GOy0/TkGAEa2zZlKQLxiUQGBu8zJ0tiVkvT36xOW11wjokIN3JBx1GHQ+hIfItiFbDpO q1TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=14nxO9j7zKvWoVWpxkSryc9gstquX1XPU07IsIBkvlQ=; b=TWyR4EcaoJgK58xLrV/cNyU8DCiUabFGhbOsBAeiCgVtM06i4T7Xsg8jLYscxH++fq DwQlESd4qE6HzWqj5N5l58X+++holYk2EZC/BsQKTdav1PraTUZsQEhOJLvAktxtJov6 vuAwXWXhKxH4MsuElMms1f7tgJaMS3GEmZ4YLlpZq+ztAEo+QCP8MjPxSUzSdUc5hcYl ALFC1mnn08T7onlkekTIGwvWS+r1AGLFX68c/ta00RBD7eHNMqjCT1TpVOiuNPkmCU7V viyMqOkpRSVqlGkLWrJt70cqM8+iTp+n62ZCqs2yCAT7tVSfvMlF0U2v+s0cKqLtp/uu gHJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 r10si1440045pfg.199.2017.06.27.00.28.14; Tue, 27 Jun 2017 00:28:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752380AbdF0H2H (ORCPT + 1 other); Tue, 27 Jun 2017 03:28:07 -0400 Received: from foss.arm.com ([217.140.101.70]:52432 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752364AbdF0H17 (ORCPT ); Tue, 27 Jun 2017 03:27:59 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 987901596; Tue, 27 Jun 2017 00:27:53 -0700 (PDT) Received: from gby.kfn.arm.com (unknown [10.45.48.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1663D3F4FF; Tue, 27 Jun 2017 00:27:51 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ofir Drang Subject: [PATCH 03/14] staging: ccree: fix else placement Date: Tue, 27 Jun 2017 10:27:15 +0300 Message-Id: <1498548449-10803-4-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498548449-10803-1-git-send-email-gilad@benyossef.com> References: <1498548449-10803-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fix cases where the else clause was not located correctly after the if brace. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 3 +-- drivers/staging/ccree/ssi_pm.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index 5c46145..3c74ae3 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.c +++ b/drivers/staging/ccree/ssi_buffer_mgr.c @@ -852,8 +852,7 @@ static inline int ssi_buffer_mgr_aead_chain_assoc( sg_index = current_sg->length; if (sg_index > size_of_assoc) { //the first entry in the scatter list contains all the associated data mapped_nents++; - } - else{ + } else { while (sg_index <= size_of_assoc) { current_sg = sg_next(current_sg); //if have reached the end of the sgl, then this is unexpected diff --git a/drivers/staging/ccree/ssi_pm.c b/drivers/staging/ccree/ssi_pm.c index c8c5875..ae1f7f0 100644 --- a/drivers/staging/ccree/ssi_pm.c +++ b/drivers/staging/ccree/ssi_pm.c @@ -110,8 +110,7 @@ int ssi_power_mgr_runtime_put_suspend(struct device *dev) (struct ssi_drvdata *)dev_get_drvdata(dev))) { pm_runtime_mark_last_busy(dev); rc = pm_runtime_put_autosuspend(dev); - } - else { + } else { /* Something wrong happens*/ BUG(); } From patchwork Tue Jun 27 07:27:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 106401 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp909544qge; Tue, 27 Jun 2017 00:32:03 -0700 (PDT) X-Received: by 10.98.76.145 with SMTP id e17mr3917762pfj.78.1498548723361; Tue, 27 Jun 2017 00:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498548723; cv=none; d=google.com; s=arc-20160816; b=gLemqWPWXpDeZrt1e6AzfiQcZOxtdx3TnI4ZeZm1hGX8m9El78PWoPV5fgKVm2BUuW 6HRmfM2vBrIDMJUU7PZ7vcDtVbOHG4Dg6v/voCcWXWsyCRmZvBIQcBmctgWXm7ht0GWG mnWzEjtLybATj2ls5WSfoFCZY8LWck5Yl/+1CBJc6fofb4qS2+xizz8t7uRbKgsSDTmi Bm4URz+3sE9PXJbC2R/e+nh7VFX349WqkGDVj8FPpj8AWY9FpO7A425iqymEFGkau6fj HbC1wE8JQXaoPY1hR+Ew3IsPd85/WFHEfYfD1q3Ez5H8oKRrvhjYuhtKlYs2K+wzd2XS F1IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=qog/a064tG8ltJXjngePU6Rrmn1qIt6lpkXmMuJXVvs=; b=K2XD1HTuDhGwnBKjzEZmQU6qm5WHSNNnTvcFMW/lfPRXJgchSpn5sYrVxucuiJzki4 qJbLj0X82mVu+Ixd21QPvW6IPOrt+kZB6+mCjTHrEWB75r6TNNN+t2VNdwDnQxBDwC8p yXQT+Yubk2ydJXy4gmeSzTH7JcgJq6ieQcwbJplmMxPL4H8AQVpAgpHQ883O2/fXmgj0 Sks7hQsVrF6vc5rrLGd1uVLwoiL7tcHLLFLezSqEZmlj7Jl++a2iBiX3t8YoI/RQfiLi 3RYly/1xE0hMr1BlYqeNP5nsFWTsQzn6hj0hzup5/oKcAV8KMGWz9v+8DPn6nXXqmqxt lXDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 o184si1458641pga.112.2017.06.27.00.32.03; Tue, 27 Jun 2017 00:32:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752520AbdF0Hbn (ORCPT + 1 other); Tue, 27 Jun 2017 03:31:43 -0400 Received: from foss.arm.com ([217.140.101.70]:52442 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752366AbdF0H17 (ORCPT ); Tue, 27 Jun 2017 03:27:59 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BCB7615A2; Tue, 27 Jun 2017 00:27:58 -0700 (PDT) Received: from gby.kfn.arm.com (unknown [10.45.48.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3B9AB3F4FF; Tue, 27 Jun 2017 00:27:57 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ofir Drang Subject: [PATCH 04/14] staging: ccree: remove redundant blank lines Date: Tue, 27 Jun 2017 10:27:16 +0300 Message-Id: <1498548449-10803-5-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498548449-10803-1-git-send-email-gilad@benyossef.com> References: <1498548449-10803-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Remove redundant blank lines in brace blocks Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 2 -- drivers/staging/ccree/ssi_buffer_mgr.c | 8 -------- drivers/staging/ccree/ssi_cipher.c | 5 ----- drivers/staging/ccree/ssi_driver.c | 1 - drivers/staging/ccree/ssi_hash.c | 2 -- drivers/staging/ccree/ssi_pm.c | 1 - drivers/staging/ccree/ssi_request_mgr.c | 1 - 7 files changed, 20 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index 00375b6..5782c9d 100644 --- a/drivers/staging/ccree/ssi_aead.c +++ b/drivers/staging/ccree/ssi_aead.c @@ -2042,7 +2042,6 @@ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction /* do we need to generate IV? */ if (areq_ctx->backup_giv != NULL) { - /* set the DMA mapped IV address*/ if (ctx->cipher_mode == DRV_CIPHER_CTR) { ssi_req.ivgen_dma_addr[0] = areq_ctx->gen_ctx.iv_dma_addr + CTR_RFC3686_NONCE_SIZE; @@ -2181,7 +2180,6 @@ static int ssi_aead_decrypt(struct aead_request *req) req->iv = areq_ctx->backup_iv; return rc; - } #if SSI_CC_HAS_AES_CCM diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index 3c74ae3..63f057e 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.c +++ b/drivers/staging/ccree/ssi_buffer_mgr.c @@ -608,7 +608,6 @@ int ssi_buffer_mgr_map_blkcipher_request( rc = ssi_buffer_mgr_generate_mlli(dev, &sg_data, mlli_params); if (unlikely(rc != 0)) goto ablkcipher_exit; - } SSI_LOG_DEBUG("areq_ctx->dma_buf_type = %s\n", @@ -877,7 +876,6 @@ static inline int ssi_buffer_mgr_aead_chain_assoc( if (areq_ctx->ccm_hdr_size != ccm_header_size_null) { if (unlikely((mapped_nents + 1) > LLI_MAX_NUM_OF_ASSOC_DATA_ENTRIES)) { - SSI_LOG_ERR("CCM case.Too many fragments. " "Current %d max %d\n", (areq_ctx->assoc.nents + 1), @@ -895,7 +893,6 @@ static inline int ssi_buffer_mgr_aead_chain_assoc( if (unlikely((do_chain) || (areq_ctx->assoc_buff_type == SSI_DMA_BUF_MLLI))) { - SSI_LOG_DEBUG("Chain assoc: buff_type=%s nents=%u\n", GET_DMA_BUFFER_TYPE(areq_ctx->assoc_buff_type), areq_ctx->assoc.nents); @@ -1178,7 +1175,6 @@ static inline int ssi_buffer_mgr_aead_chain_data( //check where the data starts while (sg_index <= size_to_skip) { - offset -= areq_ctx->dstSgl->length; areq_ctx->dstSgl = sg_next(areq_ctx->dstSgl); //if have reached the end of the sgl, then this is unexpected @@ -1450,7 +1446,6 @@ int ssi_buffer_mgr_map_aead_request( if (unlikely( (areq_ctx->assoc_buff_type == SSI_DMA_BUF_MLLI) || (areq_ctx->data_buff_type == SSI_DMA_BUF_MLLI))) { - mlli_params->curr_pool = buff_mgr->mlli_buffs_pool; rc = ssi_buffer_mgr_generate_mlli(dev, &sg_data, mlli_params); if (unlikely(rc != 0)) { @@ -1528,7 +1523,6 @@ int ssi_buffer_mgr_map_hash_request_final( } else { areq_ctx->data_dma_buf_type = SSI_DMA_BUF_MLLI; } - } /*build mlli */ @@ -1675,7 +1669,6 @@ int ssi_buffer_mgr_map_hash_request_update( mlli_params) != 0)) { goto fail_unmap_din; } - } areq_ctx->buff_index = (areq_ctx->buff_index ^ swap_index); @@ -1771,7 +1764,6 @@ int ssi_buffer_mgr_fini(struct ssi_drvdata *drvdata) dma_pool_destroy(buff_mgr_handle->mlli_buffs_pool); kfree(drvdata->buff_mgr_handle); drvdata->buff_mgr_handle = NULL; - } return 0; } diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c index 1dab3e6..722b307 100644 --- a/drivers/staging/ccree/ssi_cipher.c +++ b/drivers/staging/ccree/ssi_cipher.c @@ -104,7 +104,6 @@ static int validate_keys_sizes(struct ssi_ablkcipher_ctx *ctx_p, u32 size) { #endif default: break; - } return -EINVAL; } @@ -158,7 +157,6 @@ static int validate_data_size(struct ssi_ablkcipher_ctx *ctx_p, unsigned int siz #endif /*SSI_CC_HAS_MULTI2*/ default: break; - } return -EINVAL; } @@ -498,7 +496,6 @@ ssi_blkcipher_create_setup_desc( set_cipher_mode(&desc[*seq_size], cipher_mode); set_cipher_config0(&desc[*seq_size], direction); if (flow_mode == S_DIN_to_AES) { - if (ssi_is_hw_key(tfm)) { set_hw_crypto_key(&desc[*seq_size], ctx_p->hw.key1_slot); @@ -616,7 +613,6 @@ static inline void ssi_blkcipher_create_multi2_setup_desc( set_cipher_mode(&desc[*seq_size], ctx_p->cipher_mode); set_setup_mode(&desc[*seq_size], SETUP_LOAD_STATE1); (*seq_size)++; - } #endif /*SSI_CC_HAS_MULTI2*/ @@ -782,7 +778,6 @@ static int ssi_blkcipher_process( } /*For CTS in case of data size aligned to 16 use CBC mode*/ if (((nbytes % AES_BLOCK_SIZE) == 0) && (ctx_p->cipher_mode == DRV_CIPHER_CBC_CTS)) { - ctx_p->cipher_mode = DRV_CIPHER_CBC; cts_restore_flag = 1; } diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging/ccree/ssi_driver.c index 05930e8..3168930 100644 --- a/drivers/staging/ccree/ssi_driver.c +++ b/drivers/staging/ccree/ssi_driver.c @@ -444,7 +444,6 @@ void fini_cc_regs(struct ssi_drvdata *drvdata) /* Mask all interrupts */ WRITE_REGISTER(drvdata->cc_base + CC_REG_OFFSET(HOST_RGF, HOST_IMR), 0xFFFFFFFF); - } static void cleanup_cc_resources(struct platform_device *plat_dev) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index 64e969e..9d5e54d 100644 --- a/drivers/staging/ccree/ssi_hash.c +++ b/drivers/staging/ccree/ssi_hash.c @@ -1323,7 +1323,6 @@ static void ssi_hash_free_ctx(struct ssi_hash_ctx *ctx) } ctx->key_params.keylen = 0; - } @@ -2365,7 +2364,6 @@ int ssi_hash_free(struct ssi_drvdata *drvdata) struct ssi_hash_handle *hash_handle = drvdata->hash_handle; if (hash_handle != NULL) { - list_for_each_entry_safe(t_hash_alg, hash_n, &hash_handle->hash_list, entry) { crypto_unregister_ahash(&t_hash_alg->ahash_alg); list_del(&t_hash_alg->entry); diff --git a/drivers/staging/ccree/ssi_pm.c b/drivers/staging/ccree/ssi_pm.c index ae1f7f0..d3ddfb1 100644 --- a/drivers/staging/ccree/ssi_pm.c +++ b/drivers/staging/ccree/ssi_pm.c @@ -115,7 +115,6 @@ int ssi_power_mgr_runtime_put_suspend(struct device *dev) BUG(); } return rc; - } #endif diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index 3176578..8f7d2ec 100644 --- a/drivers/staging/ccree/ssi_request_mgr.c +++ b/drivers/staging/ccree/ssi_request_mgr.c @@ -549,7 +549,6 @@ static void comp_handler(unsigned long devarg) request_mgr_handle->axi_completed += cc_axi_comp_count(cc_base); } - } /* after verifing that there is nothing to do, Unmask AXI completion interrupt */ CC_HAL_WRITE_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_IMR), From patchwork Tue Jun 27 07:27:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 106392 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp907030qge; Tue, 27 Jun 2017 00:28:44 -0700 (PDT) X-Received: by 10.84.217.86 with SMTP id e22mr4465148plj.140.1498548524267; Tue, 27 Jun 2017 00:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498548524; cv=none; d=google.com; s=arc-20160816; b=qkdPFyGl3PaKV+aSsdQYMHL8Z7ux5NGZM12RxanFijcfDzcB+ft9wA+bTH97wyhaXL tZbzDoBFc+jc3F9ODVixaiel7LGmI8GwNtJl1az/kT21brfe2tjv1sAiFXS7z8eMzsGe DFoFnAjhBhlwIjZJAC1dwx0vVLckWIRUiFqNhI0QHOz94CKg7DmMNzLIdHf1gmEIBz0y PxrIp/9+BnWAInLU2j+j5+JDpxWdC/Da5DF6ESqXLyfAHC7Ci10umeh69bRpB+uuS30v uotJR9yEFzRxyy/SPmP/5YWbFK4Y7NcJ1DKOcwTqUQyFh0iVoctlL0kEn93TCYUbVnOk yGjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=nmJoBPBU1xYNLixDkjQbHOHmEuzst3Hngp/ZsN+7uV0=; b=QGOqFGsmepm0NKkvAlFtE3UabPK50D66hRyItN4aE2QBaa3Zmcg8QKFqci2K8S5gcm jTFFiTsV8o+uMpGJ4PNpBNzKCKOXrt77aaIOBc2XaaMIqjTJVZtf5RCbOij6oUIrKNS9 /rSKJcGpY2oqfBNeG7tdo1PXh4FECXx2xWqPoTemL5+4hcgDL/3o0v5tF86+ImY/3Qa8 SzovUqySZAem5O8NVJgKX9rw6gCbuJBwl5Z/qqAZ/5miw5xd1q8UP7v+SYUZUiRaf5t7 1a2t2y3WSBZXZnoNmAr4fgfylN83ejf2ak+sCWRTF53fybHXoWdjf7+GoV0GbeU57/2Z fhpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 u10si1454567pfi.252.2017.06.27.00.28.44; Tue, 27 Jun 2017 00:28:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752510AbdF0H22 (ORCPT + 1 other); Tue, 27 Jun 2017 03:28:28 -0400 Received: from foss.arm.com ([217.140.101.70]:52480 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752498AbdF0H2V (ORCPT ); Tue, 27 Jun 2017 03:28:21 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C3E9E344; Tue, 27 Jun 2017 00:28:20 -0700 (PDT) Received: from gby.kfn.arm.com (unknown [10.45.48.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7A8343F4FF; Tue, 27 Jun 2017 00:28:18 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ofir Drang Subject: [PATCH 08/14] staging: ccree: fix pointer location Date: Tue, 27 Jun 2017 10:27:20 +0300 Message-Id: <1498548449-10803-9-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498548449-10803-1-git-send-email-gilad@benyossef.com> References: <1498548449-10803-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fix location of pointer in variables definitions and dereference. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.h | 4 ++-- drivers/staging/ccree/ssi_buffer_mgr.c | 12 ++++++------ drivers/staging/ccree/ssi_cipher.c | 8 ++++---- drivers/staging/ccree/ssi_fips_ll.c | 24 ++++++++++++------------ drivers/staging/ccree/ssi_fips_local.c | 2 +- drivers/staging/ccree/ssi_hash.c | 2 +- drivers/staging/ccree/ssi_hash.h | 6 +++--- drivers/staging/ccree/ssi_request_mgr.c | 10 +++++----- drivers/staging/ccree/ssi_sysfs.c | 4 ++-- 9 files changed, 36 insertions(+), 36 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/ssi_aead.h b/drivers/staging/ccree/ssi_aead.h index 07cab84..d69e729 100644 --- a/drivers/staging/ccree/ssi_aead.h +++ b/drivers/staging/ccree/ssi_aead.h @@ -98,8 +98,8 @@ struct aead_req_ctx { struct ssi_mlli assoc; struct ssi_mlli src; struct ssi_mlli dst; - struct scatterlist* srcSgl; - struct scatterlist* dstSgl; + struct scatterlist *srcSgl; + struct scatterlist *dstSgl; unsigned int srcOffset; unsigned int dstOffset; enum ssi_req_dma_buf_type assoc_buff_type; diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index e060ea1..1b41c12 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.c +++ b/drivers/staging/ccree/ssi_buffer_mgr.c @@ -66,7 +66,7 @@ struct buffer_array { int total_data_len[MAX_NUM_OF_BUFFERS_IN_MLLI]; enum dma_buffer_type type[MAX_NUM_OF_BUFFERS_IN_MLLI]; bool is_last[MAX_NUM_OF_BUFFERS_IN_MLLI]; - u32 * mlli_nents[MAX_NUM_OF_BUFFERS_IN_MLLI]; + u32 *mlli_nents[MAX_NUM_OF_BUFFERS_IN_MLLI]; }; /** @@ -409,7 +409,7 @@ static int ssi_buffer_mgr_map_scatterlist( static inline int ssi_aead_handle_config_buf(struct device *dev, struct aead_req_ctx *areq_ctx, - u8* config_data, + u8 *config_data, struct buffer_array *sg_data, unsigned int assoclen) { @@ -444,7 +444,7 @@ ssi_aead_handle_config_buf(struct device *dev, static inline int ssi_ahash_handle_curr_buf(struct device *dev, struct ahash_req_ctx *areq_ctx, - u8* curr_buff, + u8 *curr_buff, u32 curr_buff_cnt, struct buffer_array *sg_data) { @@ -1460,7 +1460,7 @@ int ssi_buffer_mgr_map_hash_request_final( { struct ahash_req_ctx *areq_ctx = (struct ahash_req_ctx *)ctx; struct device *dev = &drvdata->plat_dev->dev; - u8* curr_buff = areq_ctx->buff_index ? areq_ctx->buff1 : + u8 *curr_buff = areq_ctx->buff_index ? areq_ctx->buff1 : areq_ctx->buff0; u32 *curr_buff_cnt = areq_ctx->buff_index ? &areq_ctx->buff1_cnt : &areq_ctx->buff0_cnt; @@ -1551,11 +1551,11 @@ int ssi_buffer_mgr_map_hash_request_update( { struct ahash_req_ctx *areq_ctx = (struct ahash_req_ctx *)ctx; struct device *dev = &drvdata->plat_dev->dev; - u8* curr_buff = areq_ctx->buff_index ? areq_ctx->buff1 : + u8 *curr_buff = areq_ctx->buff_index ? areq_ctx->buff1 : areq_ctx->buff0; u32 *curr_buff_cnt = areq_ctx->buff_index ? &areq_ctx->buff1_cnt : &areq_ctx->buff0_cnt; - u8* next_buff = areq_ctx->buff_index ? areq_ctx->buff0 : + u8 *next_buff = areq_ctx->buff_index ? areq_ctx->buff0 : areq_ctx->buff1; u32 *next_buff_cnt = areq_ctx->buff_index ? &areq_ctx->buff0_cnt : &areq_ctx->buff1_cnt; diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c index 1baa215..b4fc9a6 100644 --- a/drivers/staging/ccree/ssi_cipher.c +++ b/drivers/staging/ccree/ssi_cipher.c @@ -268,11 +268,11 @@ static const u8 zero_buff[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, static int ssi_fips_verify_3des_keys(const u8 *key, unsigned int keylen) { #ifdef CCREE_FIPS_SUPPORT - tdes_keys_t *tdes_key = (tdes_keys_t*)key; + tdes_keys_t *tdes_key = (tdes_keys_t *)key; /* verify key1 != key2 and key3 != key2*/ - if (unlikely((memcmp((u8*)tdes_key->key1, (u8*)tdes_key->key2, sizeof(tdes_key->key1)) == 0) || - (memcmp((u8*)tdes_key->key3, (u8*)tdes_key->key2, sizeof(tdes_key->key3)) == 0))) { + if (unlikely((memcmp((u8 *)tdes_key->key1, (u8 *)tdes_key->key2, sizeof(tdes_key->key1)) == 0) || + (memcmp((u8 *)tdes_key->key3, (u8 *)tdes_key->key2, sizeof(tdes_key->key3)) == 0))) { return -ENOEXEC; } #endif /* CCREE_FIPS_SUPPORT */ @@ -342,7 +342,7 @@ static int ssi_blkcipher_setkey(struct crypto_tfm *tfm, if (ssi_is_hw_key(tfm)) { /* setting HW key slots */ - struct arm_hw_key_info *hki = (struct arm_hw_key_info*)key; + struct arm_hw_key_info *hki = (struct arm_hw_key_info *)key; if (unlikely(ctx_p->flow_mode != S_DIN_to_AES)) { SSI_LOG_ERR("HW key not supported for non-AES flows\n"); diff --git a/drivers/staging/ccree/ssi_fips_ll.c b/drivers/staging/ccree/ssi_fips_ll.c index 804384d..4a11f15 100644 --- a/drivers/staging/ccree/ssi_fips_ll.c +++ b/drivers/staging/ccree/ssi_fips_ll.c @@ -430,7 +430,7 @@ ssi_cipher_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffe for (i = 0; i < FIPS_CIPHER_NUM_OF_TESTS; ++i) { - FipsCipherData *cipherData = (FipsCipherData*)&FipsCipherDataTable[i]; + FipsCipherData *cipherData = (FipsCipherData *)&FipsCipherDataTable[i]; int rc = 0; size_t iv_size = cipherData->isAes ? NIST_AES_IV_SIZE : NIST_TDES_IV_SIZE; @@ -558,7 +558,7 @@ ssi_cmac_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, for (i = 0; i < FIPS_CMAC_NUM_OF_TESTS; ++i) { - FipsCmacData *cmac_data = (FipsCmacData*)&FipsCmacDataTable[i]; + FipsCmacData *cmac_data = (FipsCmacData *)&FipsCmacDataTable[i]; int rc = 0; memset(cpu_addr_buffer, 0, sizeof(struct fips_cmac_ctx)); @@ -704,7 +704,7 @@ ssi_hash_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, for (i = 0; i < FIPS_HASH_NUM_OF_TESTS; ++i) { - FipsHashData *hash_data = (FipsHashData*)&FipsHashDataTable[i]; + FipsHashData *hash_data = (FipsHashData *)&FipsHashDataTable[i]; int rc = 0; enum drv_hash_hw_mode hw_mode = 0; int digest_size = 0; @@ -718,20 +718,20 @@ ssi_hash_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, digest_size = CC_SHA1_DIGEST_SIZE; inter_digestsize = CC_SHA1_DIGEST_SIZE; /* copy the initial digest into the allocated cache coherent buffer */ - memcpy(virt_ctx->initial_digest, (void*)sha1_init, CC_SHA1_DIGEST_SIZE); + memcpy(virt_ctx->initial_digest, (void *)sha1_init, CC_SHA1_DIGEST_SIZE); break; case DRV_HASH_SHA256: hw_mode = DRV_HASH_HW_SHA256; digest_size = CC_SHA256_DIGEST_SIZE; inter_digestsize = CC_SHA256_DIGEST_SIZE; - memcpy(virt_ctx->initial_digest, (void*)sha256_init, CC_SHA256_DIGEST_SIZE); + memcpy(virt_ctx->initial_digest, (void *)sha256_init, CC_SHA256_DIGEST_SIZE); break; #if (CC_SUPPORT_SHA > 256) case DRV_HASH_SHA512: hw_mode = DRV_HASH_HW_SHA512; digest_size = CC_SHA512_DIGEST_SIZE; inter_digestsize = CC_SHA512_DIGEST_SIZE; - memcpy(virt_ctx->initial_digest, (void*)sha512_init, CC_SHA512_DIGEST_SIZE); + memcpy(virt_ctx->initial_digest, (void *)sha512_init, CC_SHA512_DIGEST_SIZE); break; #endif default: @@ -1024,7 +1024,7 @@ ssi_hmac_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, for (i = 0; i < FIPS_HMAC_NUM_OF_TESTS; ++i) { - FipsHmacData *hmac_data = (FipsHmacData*)&FipsHmacDataTable[i]; + FipsHmacData *hmac_data = (FipsHmacData *)&FipsHmacDataTable[i]; int rc = 0; enum drv_hash_hw_mode hw_mode = 0; int digest_size = 0; @@ -1039,7 +1039,7 @@ ssi_hmac_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, digest_size = CC_SHA1_DIGEST_SIZE; block_size = CC_SHA1_BLOCK_SIZE; inter_digestsize = CC_SHA1_DIGEST_SIZE; - memcpy(virt_ctx->initial_digest, (void*)sha1_init, CC_SHA1_DIGEST_SIZE); + memcpy(virt_ctx->initial_digest, (void *)sha1_init, CC_SHA1_DIGEST_SIZE); memcpy(virt_ctx->digest_bytes_len, digest_len_init, HASH_LEN_SIZE); break; case DRV_HASH_SHA256: @@ -1047,7 +1047,7 @@ ssi_hmac_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, digest_size = CC_SHA256_DIGEST_SIZE; block_size = CC_SHA256_BLOCK_SIZE; inter_digestsize = CC_SHA256_DIGEST_SIZE; - memcpy(virt_ctx->initial_digest, (void*)sha256_init, CC_SHA256_DIGEST_SIZE); + memcpy(virt_ctx->initial_digest, (void *)sha256_init, CC_SHA256_DIGEST_SIZE); memcpy(virt_ctx->digest_bytes_len, digest_len_init, HASH_LEN_SIZE); break; #if (CC_SUPPORT_SHA > 256) @@ -1056,7 +1056,7 @@ ssi_hmac_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, digest_size = CC_SHA512_DIGEST_SIZE; block_size = CC_SHA512_BLOCK_SIZE; inter_digestsize = CC_SHA512_DIGEST_SIZE; - memcpy(virt_ctx->initial_digest, (void*)sha512_init, CC_SHA512_DIGEST_SIZE); + memcpy(virt_ctx->initial_digest, (void *)sha512_init, CC_SHA512_DIGEST_SIZE); memcpy(virt_ctx->digest_bytes_len, digest_len_sha512_init, HASH_LEN_SIZE); break; #endif @@ -1266,7 +1266,7 @@ ssi_ccm_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, for (i = 0; i < FIPS_CCM_NUM_OF_TESTS; ++i) { - FipsCcmData *ccmData = (FipsCcmData*)&FipsCcmDataTable[i]; + FipsCcmData *ccmData = (FipsCcmData *)&FipsCcmDataTable[i]; int rc = 0; memset(cpu_addr_buffer, 0, sizeof(struct fips_ccm_ctx)); @@ -1566,7 +1566,7 @@ ssi_gcm_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, for (i = 0; i < FIPS_GCM_NUM_OF_TESTS; ++i) { - FipsGcmData *gcmData = (FipsGcmData*)&FipsGcmDataTable[i]; + FipsGcmData *gcmData = (FipsGcmData *)&FipsGcmDataTable[i]; int rc = 0; memset(cpu_addr_buffer, 0, sizeof(struct fips_gcm_ctx)); diff --git a/drivers/staging/ccree/ssi_fips_local.c b/drivers/staging/ccree/ssi_fips_local.c index c571b85..50d7189 100644 --- a/drivers/staging/ccree/ssi_fips_local.c +++ b/drivers/staging/ccree/ssi_fips_local.c @@ -165,7 +165,7 @@ static void fips_dsr(unsigned long devarg) ssi_fips_error_t cc_fips_run_power_up_tests(struct ssi_drvdata *drvdata) { ssi_fips_error_t fips_error = CC_REE_FIPS_ERROR_OK; - void * cpu_addr_buffer = NULL; + void *cpu_addr_buffer = NULL; dma_addr_t dma_handle; size_t alloc_buff_size = ssi_fips_max_mem_alloc_size(); struct device *dev = &drvdata->plat_dev->dev; diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index 7a70d87..79655bb 100644 --- a/drivers/staging/ccree/ssi_hash.c +++ b/drivers/staging/ccree/ssi_hash.c @@ -1358,7 +1358,7 @@ static int ssi_hash_alloc_ctx(struct ssi_hash_ctx *ctx) static int ssi_ahash_cra_init(struct crypto_tfm *tfm) { struct ssi_hash_ctx *ctx = crypto_tfm_ctx(tfm); - struct hash_alg_common * hash_alg_common = + struct hash_alg_common *hash_alg_common = container_of(tfm->__crt_alg, struct hash_alg_common, base); struct ahash_alg *ahash_alg = container_of(hash_alg_common, struct ahash_alg, halg); diff --git a/drivers/staging/ccree/ssi_hash.h b/drivers/staging/ccree/ssi_hash.h index 0bb99cb..2400e38 100644 --- a/drivers/staging/ccree/ssi_hash.h +++ b/drivers/staging/ccree/ssi_hash.h @@ -50,9 +50,9 @@ struct aeshash_state { /* ahash state */ struct ahash_req_ctx { - u8* buff0; - u8* buff1; - u8* digest_result_buff; + u8 *buff0; + u8 *buff1; + u8 *digest_result_buff; struct async_gen_req_ctx gen_ctx; enum ssi_req_dma_buf_type data_dma_buf_type; u8 *digest_buff; diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index ecd4a8b..f6f7ea8 100644 --- a/drivers/staging/ccree/ssi_request_mgr.c +++ b/drivers/staging/ccree/ssi_request_mgr.c @@ -452,7 +452,7 @@ static void proc_completions(struct ssi_drvdata *drvdata) { struct ssi_crypto_req *ssi_req; struct platform_device *plat_dev = drvdata->plat_dev; - struct ssi_request_mgr_handle * request_mgr_handle = + struct ssi_request_mgr_handle *request_mgr_handle = drvdata->request_mgr_handle; #if defined(CONFIG_PM_RUNTIME) || defined(CONFIG_PM_SLEEP) int rc = 0; @@ -511,7 +511,7 @@ static void comp_handler(unsigned long devarg) { struct ssi_drvdata *drvdata = (struct ssi_drvdata *)devarg; void __iomem *cc_base = drvdata->cc_base; - struct ssi_request_mgr_handle * request_mgr_handle = + struct ssi_request_mgr_handle *request_mgr_handle = drvdata->request_mgr_handle; u32 irq; @@ -559,7 +559,7 @@ static void comp_handler(unsigned long devarg) #if defined(CONFIG_PM_RUNTIME) || defined(CONFIG_PM_SLEEP) int ssi_request_mgr_runtime_resume_queue(struct ssi_drvdata *drvdata) { - struct ssi_request_mgr_handle * request_mgr_handle = drvdata->request_mgr_handle; + struct ssi_request_mgr_handle *request_mgr_handle = drvdata->request_mgr_handle; spin_lock_bh(&request_mgr_handle->hw_lock); request_mgr_handle->is_runtime_suspended = false; @@ -574,7 +574,7 @@ int ssi_request_mgr_runtime_resume_queue(struct ssi_drvdata *drvdata) */ int ssi_request_mgr_runtime_suspend_queue(struct ssi_drvdata *drvdata) { - struct ssi_request_mgr_handle * request_mgr_handle = + struct ssi_request_mgr_handle *request_mgr_handle = drvdata->request_mgr_handle; /* lock the send_request */ @@ -592,7 +592,7 @@ int ssi_request_mgr_runtime_suspend_queue(struct ssi_drvdata *drvdata) bool ssi_request_mgr_is_queue_runtime_suspend(struct ssi_drvdata *drvdata) { - struct ssi_request_mgr_handle * request_mgr_handle = + struct ssi_request_mgr_handle *request_mgr_handle = drvdata->request_mgr_handle; return request_mgr_handle->is_runtime_suspended; diff --git a/drivers/staging/ccree/ssi_sysfs.c b/drivers/staging/ccree/ssi_sysfs.c index 8de4353..75c9a89 100644 --- a/drivers/staging/ccree/ssi_sysfs.c +++ b/drivers/staging/ccree/ssi_sysfs.c @@ -285,7 +285,7 @@ static ssize_t ssi_sys_regdump_show(struct kobject *kobj, { struct ssi_drvdata *drvdata = sys_get_drvdata(); u32 register_value; - void __iomem* cc_base = drvdata->cc_base; + void __iomem *cc_base = drvdata->cc_base; int offset = 0; register_value = CC_HAL_READ_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_SIGNATURE)); @@ -304,7 +304,7 @@ static ssize_t ssi_sys_regdump_show(struct kobject *kobj, static ssize_t ssi_sys_help_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { - char* help_str[] = { + char *help_str[] = { "cat reg_dump ", "Print several of CC register values", #if defined CC_CYCLE_COUNT "cat stats_host ", "Print host statistics", From patchwork Tue Jun 27 07:27:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 106397 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp907990qge; Tue, 27 Jun 2017 00:30:05 -0700 (PDT) X-Received: by 10.84.215.23 with SMTP id k23mr4273260pli.104.1498548605839; Tue, 27 Jun 2017 00:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498548605; cv=none; d=google.com; s=arc-20160816; b=YJ9gXhaOvQE9OtTTwyBh48JvVVOcKrCX8T4DKRZ73N18v5U01QZzo9ra2AYwAictxa FQTaNKMrU95MrSLINP3d0NgjBx+UCunGKy0vUpQj/JN6e8MtLlgwkmshKcjTHoWNOkUF NFFYaMOUlQCjpywPPbdqO5G++2ygL+u/F8koKLqeOJGUdQuLonSnF5GMsVRGVOtBxaKt t2r4eKjhn349xePwlSR7zhveEwuf3NBfiPrGy/ehxQ8sC61SgCdtGb7Y1rwjtwgS66H+ m/vAWUWsKcdhxrPK1kB+d5b3cW9NGxk4FXO7g6XEqbBgHXpcwMHlMeGhHiLnxKHHDyyF 3WIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=9GNk3zgEU/3HatzbelJHbh4HbCd+BVFuuYmfZpiaq2w=; b=JvaUesed+og4ifUYOHvjYTCC7c8SbrO8OiydtTrEFdO5dOGsAxy274SzrucZ2tzzEM Fru0U1/Amh4bdF6qBUFgv3FzJvidLH6D0T9ge97pNhw7MsrX78iP8plLTqbn1jbk6csz DJq3A/37Qor8Xr/0GCSQnrzoqMhpWTRpdnBNmrUj/P3R0ZFBkelY9oEqh1gRMUPPygLO TxmPbrhsyPZZ7BUGQKLoigEj3dXpNZ41Vm3sQZLpNdyNmHyWUFgNcijeKqFoPzqWvUdw vA1aXQdUIIbHZ5+ZyKxO71Rw2FaDpa7zrzC5wmRtefQPi8M7nVeNfaG9HDD7siDpwujx E/dQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 d193si1434483pgc.115.2017.06.27.00.30.05; Tue, 27 Jun 2017 00:30:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751694AbdF0H35 (ORCPT + 1 other); Tue, 27 Jun 2017 03:29:57 -0400 Received: from foss.arm.com ([217.140.101.70]:52516 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752559AbdF0H2r (ORCPT ); Tue, 27 Jun 2017 03:28:47 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F1CC1344; Tue, 27 Jun 2017 00:28:36 -0700 (PDT) Received: from gby.kfn.arm.com (unknown [10.45.48.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6E57B3F4FF; Tue, 27 Jun 2017 00:28:35 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ofir Drang Subject: [PATCH 11/14] staging: ccree: remove custom type ssi_fips_state_t Date: Tue, 27 Jun 2017 10:27:23 +0300 Message-Id: <1498548449-10803-12-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498548449-10803-1-git-send-email-gilad@benyossef.com> References: <1498548449-10803-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Replace custom type ssi_fips_state_t with underlying enum. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_fips.c | 4 ++-- drivers/staging/ccree/ssi_fips.h | 6 +++--- drivers/staging/ccree/ssi_fips_ext.c | 6 +++--- drivers/staging/ccree/ssi_fips_local.c | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/ssi_fips.c b/drivers/staging/ccree/ssi_fips.c index 948ea49..d34d9ef 100644 --- a/drivers/staging/ccree/ssi_fips.c +++ b/drivers/staging/ccree/ssi_fips.c @@ -23,14 +23,14 @@ #include "ssi_fips.h" -extern int ssi_fips_ext_get_state(ssi_fips_state_t *p_state); +extern int ssi_fips_ext_get_state(enum cc_fips_state_t *p_state); extern int ssi_fips_ext_get_error(enum cc_fips_error *p_err); /* * This function returns the REE FIPS state. * It should be called by kernel module. */ -int ssi_fips_get_state(ssi_fips_state_t *p_state) +int ssi_fips_get_state(enum cc_fips_state_t *p_state) { int rc = 0; diff --git a/drivers/staging/ccree/ssi_fips.h b/drivers/staging/ccree/ssi_fips.h index d1cd489..ce5fa45 100644 --- a/drivers/staging/ccree/ssi_fips.h +++ b/drivers/staging/ccree/ssi_fips.h @@ -22,12 +22,12 @@ * @brief This file contains FIPS related defintions and APIs. */ -typedef enum ssi_fips_state { +enum cc_fips_state { CC_FIPS_STATE_NOT_SUPPORTED = 0, CC_FIPS_STATE_SUPPORTED, CC_FIPS_STATE_ERROR, CC_FIPS_STATE_RESERVE32B = S32_MAX -} ssi_fips_state_t; +}; enum cc_fips_error { @@ -57,7 +57,7 @@ enum cc_fips_error { -int ssi_fips_get_state(ssi_fips_state_t *p_state); +int ssi_fips_get_state(enum cc_fips_state *p_state); int ssi_fips_get_error(enum cc_fips_error *p_err); #endif /*__SSI_FIPS_H__*/ diff --git a/drivers/staging/ccree/ssi_fips_ext.c b/drivers/staging/ccree/ssi_fips_ext.c index aab2805..295aeb6 100644 --- a/drivers/staging/ccree/ssi_fips_ext.c +++ b/drivers/staging/ccree/ssi_fips_ext.c @@ -28,7 +28,7 @@ static bool tee_error; module_param(tee_error, bool, 0644); MODULE_PARM_DESC(tee_error, "Simulate TEE library failure flag: 0 - no error (default), 1 - TEE error occured "); -static ssi_fips_state_t fips_state = CC_FIPS_STATE_NOT_SUPPORTED; +static enum cc_fips_state_t fips_state = CC_FIPS_STATE_NOT_SUPPORTED; static enum cc_fips_error fips_error = CC_REE_FIPS_ERROR_OK; /* @@ -37,7 +37,7 @@ static enum cc_fips_error fips_error = CC_REE_FIPS_ERROR_OK; * the state value is stored. * The reference code uses global variable. */ -int ssi_fips_ext_get_state(ssi_fips_state_t *p_state) +int ssi_fips_ext_get_state(enum cc_fips_state_t *p_state) { int rc = 0; @@ -73,7 +73,7 @@ int ssi_fips_ext_get_error(enum cc_fips_error *p_err) * the state value is stored. * The reference code uses global variable. */ -int ssi_fips_ext_set_state(ssi_fips_state_t state) +int ssi_fips_ext_set_state(enum cc_fips_state_t state) { fips_state = state; return 0; diff --git a/drivers/staging/ccree/ssi_fips_local.c b/drivers/staging/ccree/ssi_fips_local.c index dfc871d..9b84876 100644 --- a/drivers/staging/ccree/ssi_fips_local.c +++ b/drivers/staging/ccree/ssi_fips_local.c @@ -50,9 +50,9 @@ struct ssi_fips_handle { }; -extern int ssi_fips_get_state(ssi_fips_state_t *p_state); +extern int ssi_fips_get_state(enum cc_fips_state_t *p_state); extern int ssi_fips_get_error(enum cc_fips_error *p_err); -extern int ssi_fips_ext_set_state(ssi_fips_state_t state); +extern int ssi_fips_ext_set_state(enum cc_fips_state_t state); extern int ssi_fips_ext_set_error(enum cc_fips_error err); /* FIPS power-up tests */ @@ -234,7 +234,7 @@ enum cc_fips_error cc_fips_run_power_up_tests(struct ssi_drvdata *drvdata) */ int ssi_fips_check_fips_error(void) { - ssi_fips_state_t fips_state; + enum cc_fips_state_t fips_state; if (ssi_fips_get_state(&fips_state) != 0) { FIPS_LOG("ssi_fips_get_state FAILED, returning.. \n"); @@ -251,7 +251,7 @@ int ssi_fips_check_fips_error(void) /* The function sets the REE FIPS state.* * It should be used while driver is being loaded. */ -int ssi_fips_set_state(ssi_fips_state_t state) +int ssi_fips_set_state(enum cc_fips_state_t state) { return ssi_fips_ext_set_state(state); } From patchwork Tue Jun 27 07:27:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 106393 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp907278qge; Tue, 27 Jun 2017 00:29:08 -0700 (PDT) X-Received: by 10.98.57.4 with SMTP id g4mr3899056pfa.155.1498548548529; Tue, 27 Jun 2017 00:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498548548; cv=none; d=google.com; s=arc-20160816; b=SmxfmXgs7fWbOiNxVNBNxCcYng/HAu9PJ/dtDEFg/g0qJ4NGWkIIp4qZdcxHdQ1q4o l8SsxhFdm98za6eEwFqe9gwnmuf5XQ3cDs3Y1/aTYZWF6PLZP0nstd4tGs3zHeXLGNdu C4t0RDMuO1KuQ0A+RZg35TFWtmHDQXnKM9hZKf2QU4gSal6g5uWTKEVh6Zvo3xXAvqhv Z+xN5iWXvk+mlmzhwXgP/m9H0c9p4+O0dA1cGgT/SejQRyBPtUQJuGvV1IG6GVkjqFpY JxC0Gmx3+DxFOrnuD9OMqjhC7TVegSmT/db9vvuAd87c0PbWb9XHypmKgWoDAAACucSB yP4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=5W9PAjywYv4a/k9RqJkHN7d7YfTH2ZMkm8FtcH9IE2c=; b=kFJZRoLypgABEOGJe2eIBWICu1AEseBbPqrgzR2ensf2I0OAQrUChe33dlkA5TCWjJ xDwg598bRFRGIWX8PcaQ7d4a2IeE3aRgkH851D0MryQez2yrke1dXTSmmRerGfAkoedL mdGSL+NpstKXXHecJ8ojJ3mYTMArJShZpymrhgzqmPM+VMG2O6wy5HEgz6Xs/Z4jFqgC 9Kgl+bSGhMU5fuQeIdyEbAj/Ea/98ZxvHK6qLL0E8k1npEkxQtHUdDCHNSXvzkbEK9Os VsXJnBPe1EyKA9kBc51qBVorhFrNfbLeeOkLjtNUIB3KdQrYSVT8xvUOoMUNwSrs4Ei4 QjiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 s62si1439176pgb.247.2017.06.27.00.29.08; Tue, 27 Jun 2017 00:29:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752566AbdF0H2u (ORCPT + 1 other); Tue, 27 Jun 2017 03:28:50 -0400 Received: from foss.arm.com ([217.140.101.70]:52524 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752550AbdF0H2n (ORCPT ); Tue, 27 Jun 2017 03:28:43 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 30A2F1596; Tue, 27 Jun 2017 00:28:42 -0700 (PDT) Received: from gby.kfn.arm.com (unknown [10.45.48.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9A8103F4FF; Tue, 27 Jun 2017 00:28:40 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ofir Drang Subject: [PATCH 12/14] staging: ccree: remove unused type CCFipsSyncStatus_t Date: Tue, 27 Jun 2017 10:27:24 +0300 Message-Id: <1498548449-10803-13-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498548449-10803-1-git-send-email-gilad@benyossef.com> References: <1498548449-10803-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The CCFipsSyncStatus_t type was not being used in the code. Remove it. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_fips_local.h | 10 ---------- 1 file changed, 10 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/ssi_fips_local.h b/drivers/staging/ccree/ssi_fips_local.h index 0fbb1e0..4bc7f37 100644 --- a/drivers/staging/ccree/ssi_fips_local.h +++ b/drivers/staging/ccree/ssi_fips_local.h @@ -23,16 +23,6 @@ #include "ssi_fips.h" struct ssi_drvdata; -// IG - how to make 1 file for TEE and REE -typedef enum CC_FipsSyncStatus { - CC_FIPS_SYNC_MODULE_OK = 0x0, - CC_FIPS_SYNC_MODULE_ERROR = 0x1, - CC_FIPS_SYNC_REE_STATUS = 0x4, - CC_FIPS_SYNC_TEE_STATUS = 0x8, - CC_FIPS_SYNC_STATUS_RESERVE32B = S32_MAX -} CCFipsSyncStatus_t; - - #define CHECK_AND_RETURN_UPON_FIPS_ERROR() {\ if (ssi_fips_check_fips_error() != 0) {\ return -ENOEXEC;\ From patchwork Tue Jun 27 07:27:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 106396 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp907377qge; Tue, 27 Jun 2017 00:29:15 -0700 (PDT) X-Received: by 10.99.65.194 with SMTP id o185mr3854017pga.278.1498548555636; Tue, 27 Jun 2017 00:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498548555; cv=none; d=google.com; s=arc-20160816; b=UBmdroKkQDS/9pUtMB2frB11iyQd2wgWtgjFJONys+ziTpG3GpNkAw7wbiMQZjNwM6 v5nGNz++N2BUsT3QDuz10lXSb5fATGdI/rH59N0BoKoa7dViirCp5vFl3t/Q0C5mxJcD /U5w4jqEt37QglecoKl5u9Gre8xWA8Ab/tL4X6wYjSewsHexDmCf0MDJsqaK7cctAac5 W/d9X2TVQYQ5Vwq7hW5hC/FzSQOKcgCeNNQV0VRx9OyX+3Vj37hdU6B+o6kQ6hlnwZ4z bgt5sddeRKkG+oaKccbSwOYNdGa+8oOgB/6pBsAz9twkANH8GuQIDIlP5Va4+jJoMfdf FdVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=kJU4Ib/P01Z2m4LQxIbdwA3Q8NIxjlyWwpVZoMvjElU=; b=Xd2XNPBMwk8FhdoQakBypV6Frs7XcCahgcSXN/JvTOJuseia15STKQe6gvY+x2YhYD 4CHcr3HSk+tlxx2EiJfdbc0VFfVxfVBYuUTMdFUxof8Vx+aTM84IbtoIU30j99hCRBll XZ9KZ5d8RfUWaadrsiwSE0vBLq/pgPCh7yP1ua0OPup3IVkhp7CG8NDmMEzka/1uXkDy IgTQn9FxYdRNX9K0U2+IYBzJK8iXWz3UVzMpDQaJWB3WSYcu9EA9bis3wa39stBCgaDr 6GzYsxbswFPklU8MiiBvo0jr5SIixhxH2lrFp0wveePTQobABSyqa8GK35Kd9DZrOCtO 4fFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 s62si1439176pgb.247.2017.06.27.00.29.15; Tue, 27 Jun 2017 00:29:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752272AbdF0H3M (ORCPT + 1 other); Tue, 27 Jun 2017 03:29:12 -0400 Received: from foss.arm.com ([217.140.101.70]:52540 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752574AbdF0H2x (ORCPT ); Tue, 27 Jun 2017 03:28:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D62131596; Tue, 27 Jun 2017 00:28:47 -0700 (PDT) Received: from gby.kfn.arm.com (unknown [10.45.48.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DD0B23F4FF; Tue, 27 Jun 2017 00:28:45 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ofir Drang Subject: [PATCH 13/14] staging: ccree: remove/add (un)needed blank lines Date: Tue, 27 Jun 2017 10:27:25 +0300 Message-Id: <1498548449-10803-14-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498548449-10803-1-git-send-email-gilad@benyossef.com> References: <1498548449-10803-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Remove or add blank lines as needed to match coding style. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 20 +++++-------------- drivers/staging/ccree/ssi_aead.h | 4 ---- drivers/staging/ccree/ssi_buffer_mgr.c | 7 ++++--- drivers/staging/ccree/ssi_buffer_mgr.h | 1 - drivers/staging/ccree/ssi_cipher.c | 17 +++------------- drivers/staging/ccree/ssi_cipher.h | 6 ------ drivers/staging/ccree/ssi_driver.c | 4 +--- drivers/staging/ccree/ssi_fips.c | 2 -- drivers/staging/ccree/ssi_fips.h | 3 --- drivers/staging/ccree/ssi_fips_data.h | 8 -------- drivers/staging/ccree/ssi_fips_ext.c | 2 -- drivers/staging/ccree/ssi_fips_ll.c | 35 +++++++++------------------------ drivers/staging/ccree/ssi_fips_local.c | 14 +------------ drivers/staging/ccree/ssi_fips_local.h | 4 ++-- drivers/staging/ccree/ssi_hash.c | 12 ++++------- drivers/staging/ccree/ssi_ivgen.c | 1 - drivers/staging/ccree/ssi_ivgen.h | 1 - drivers/staging/ccree/ssi_pm.c | 5 ----- drivers/staging/ccree/ssi_pm.h | 3 --- drivers/staging/ccree/ssi_request_mgr.c | 9 +++------ drivers/staging/ccree/ssi_sram_mgr.c | 2 -- drivers/staging/ccree/ssi_sram_mgr.h | 1 - drivers/staging/ccree/ssi_sysfs.c | 4 ---- drivers/staging/ccree/ssi_sysfs.h | 1 + 24 files changed, 33 insertions(+), 133 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index 53105dd..1fc0b05 100644 --- a/drivers/staging/ccree/ssi_aead.c +++ b/drivers/staging/ccree/ssi_aead.c @@ -49,7 +49,6 @@ #define AES_CCM_RFC4309_NONCE_SIZE 3 #define MAX_NONCE_SIZE CTR_RFC3686_NONCE_SIZE - /* Value of each ICV_CMP byte (of 8) in case of success */ #define ICV_VERIF_OK 0x01 @@ -209,7 +208,6 @@ static int ssi_aead_init(struct crypto_aead *tfm) return -ENOMEM; } - static void ssi_aead_complete(struct device *dev, void *ssi_req, void __iomem *cc_base) { struct aead_request *areq = (struct aead_request *)ssi_req; @@ -402,6 +400,7 @@ static int validate_keys_sizes(struct ssi_aead_ctx *ctx) return 0; /* All tests of keys sizes passed */ } + /* This function prepers the user key so it can pass to the hmac processing * (copy to intenral buffer or hash in case of key longer than block */ @@ -526,7 +525,6 @@ ssi_get_plain_hmac_key(struct crypto_aead *tfm, const u8 *key, unsigned int keyl return rc; } - static int ssi_aead_setkey(struct crypto_aead *tfm, const u8 *key, unsigned int keylen) { @@ -594,7 +592,6 @@ ssi_aead_setkey(struct crypto_aead *tfm, const u8 *key, unsigned int keylen) goto badkey; } - /* STAT_PHASE_2: Create sequence */ switch (ctx->auth_mode) { @@ -613,7 +610,6 @@ ssi_aead_setkey(struct crypto_aead *tfm, const u8 *key, unsigned int keylen) goto badkey; } - /* STAT_PHASE_3: Submit sequence to HW */ if (seq_len > 0) { /* For CCM there is no sequence to setup the key */ @@ -1372,6 +1368,7 @@ static int validate_data_size(struct ssi_aead_ctx *ctx, static unsigned int format_ccm_a0(u8 *pA0Buff, u32 headerSize) { unsigned int len = 0; + if (headerSize == 0) return 0; @@ -1424,7 +1421,6 @@ static inline int ssi_aead_ccm( unsigned int cipher_flow_mode; dma_addr_t mac_result; - if (req_ctx->gen_ctx.op_type == DRV_CRYPTO_DIRECTION_DECRYPT) { cipher_flow_mode = AES_to_HASH_and_DOUT; mac_result = req_ctx->mac_buf_dma_addr; @@ -1481,7 +1477,6 @@ static inline int ssi_aead_ccm( set_aes_not_hash_mode(&desc[idx]); idx++; - /* process assoc data */ if (req->assoclen > 0) { ssi_aead_create_assoc_desc(req, DIN_HASH, desc, &idx); @@ -1556,6 +1551,7 @@ static int config_ccm_adata(struct aead_request *req) req->cryptlen : (req->cryptlen - ctx->authsize); int rc; + memset(req_ctx->mac_buf, 0, AES_BLOCK_SIZE); memset(req_ctx->ccm_config, 0, AES_BLOCK_SIZE * 3); @@ -1808,7 +1804,6 @@ static inline int ssi_aead_gcm( cipher_flow_mode = AES_to_HASH_and_DOUT; } - //in RFC4543 no data to encrypt. just copy data from src to dest. if (req_ctx->plaintext_authenticate_only) { ssi_aead_process_cipher_data_desc(req, BYPASS, desc, seq_size); @@ -1904,15 +1899,16 @@ static int config_gcm_context(struct aead_request *req) memcpy(req->iv + 12, &counter, 4); memcpy(req_ctx->gcm_iv_inc1, req->iv, 16); - if (!req_ctx->plaintext_authenticate_only) { __be64 temp64; + temp64 = cpu_to_be64(req->assoclen * 8); memcpy(&req_ctx->gcm_len_block.lenA, &temp64, sizeof(temp64)); temp64 = cpu_to_be64(cryptlen * 8); memcpy(&req_ctx->gcm_len_block.lenC, &temp64, 8); } else { //rfc4543=> all data(AAD,IV,Plain) are considered additional data that is nothing is encrypted. __be64 temp64; + temp64 = cpu_to_be64((req->assoclen + GCM_BLOCK_RFC4_IV_SIZE + cryptlen) * 8); memcpy(&req_ctx->gcm_len_block.lenA, &temp64, sizeof(temp64)); temp64 = 0; @@ -1934,7 +1930,6 @@ static void ssi_rfc4_gcm_process(struct aead_request *req) req->assoclen -= GCM_BLOCK_RFC4_IV_SIZE; } - #endif /*SSI_CC_HAS_AES_GCM*/ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction direct) @@ -1948,7 +1943,6 @@ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction struct device *dev = &ctx->drvdata->plat_dev->dev; struct ssi_crypto_req ssi_req = {}; - SSI_LOG_DEBUG("%s context=%p req=%p iv=%p src=%p src_ofs=%d dst=%p dst_ofs=%d cryptolen=%d\n", ((direct == DRV_CRYPTO_DIRECTION_ENCRYPT) ? "Encrypt" : "Decrypt"), ctx, req, req->iv, sg_virt(req->src), req->src->offset, sg_virt(req->dst), req->dst->offset, req->cryptlen); @@ -1973,7 +1967,6 @@ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction areq_ctx->req_authsize = ctx->authsize; areq_ctx->cipher_mode = ctx->cipher_mode; - /* STAT_PHASE_1: Map buffers */ if (ctx->cipher_mode == DRV_CIPHER_CTR) { @@ -2057,7 +2050,6 @@ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction ssi_req.ivgen_size = crypto_aead_ivsize(tfm); } - /* STAT_PHASE_2: Create sequence */ /* Load MLLI tables to SRAM if necessary */ @@ -2091,7 +2083,6 @@ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction goto exit; } - /* STAT_PHASE_3: Lock HW and push sequence */ rc = send_request(ctx->drvdata, &ssi_req, desc, seq_len, 1); @@ -2101,7 +2092,6 @@ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction ssi_buffer_mgr_unmap_aead_request(dev, req); } - exit: return rc; } diff --git a/drivers/staging/ccree/ssi_aead.h b/drivers/staging/ccree/ssi_aead.h index d69e729..39cc633 100644 --- a/drivers/staging/ccree/ssi_aead.h +++ b/drivers/staging/ccree/ssi_aead.h @@ -25,13 +25,11 @@ #include #include - /* mac_cmp - HW writes 8 B but all bytes hold the same value */ #define ICV_CMP_SIZE 8 #define CCM_CONFIG_BUF_SIZE (AES_BLOCK_SIZE * 3) #define MAX_MAC_SIZE MAX(SHA256_DIGEST_SIZE, AES_BLOCK_SIZE) - /* defines for AES GCM configuration buffer */ #define GCM_BLOCK_LEN_SIZE 8 @@ -40,8 +38,6 @@ #define GCM_BLOCK_RFC4_NONCE_OFFSET 0 #define GCM_BLOCK_RFC4_NONCE_SIZE 4 - - /* Offsets into AES CCM configuration buffer */ #define CCM_B0_OFFSET 0 #define CCM_A0_OFFSET 16 diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index 1b41c12..b35871e 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.c +++ b/drivers/staging/ccree/ssi_buffer_mgr.c @@ -42,7 +42,6 @@ #define GET_DMA_BUFFER_TYPE(buff_type) #endif - enum dma_buffer_type { DMA_NULL_TYPE = -1, DMA_SGL_TYPE = 1, @@ -80,6 +79,7 @@ static unsigned int ssi_buffer_mgr_get_sgl_nents( struct scatterlist *sg_list, unsigned int nbytes, u32 *lbytes, bool *is_chained) { unsigned int nents = 0; + while (nbytes != 0) { if (sg_is_chain(sg_list)) { SSI_LOG_ERR("Unexpected chained entry " @@ -181,7 +181,6 @@ static inline int ssi_buffer_mgr_render_buff_to_mlli( return 0; } - static inline int ssi_buffer_mgr_render_scatterlist_to_mlli( struct scatterlist *sgl, u32 sgl_data_len, u32 sglOffset, u32 *curr_nents, u32 **mlli_entry_pp) @@ -322,6 +321,7 @@ ssi_buffer_mgr_dma_map_sg(struct device *dev, struct scatterlist *sg, u32 nents, { u32 i, j; struct scatterlist *l_sg = sg; + for (i = 0; i < nents; i++) { if (!l_sg) break; @@ -441,7 +441,6 @@ ssi_aead_handle_config_buf(struct device *dev, return 0; } - static inline int ssi_ahash_handle_curr_buf(struct device *dev, struct ahash_req_ctx *areq_ctx, u8 *curr_buff, @@ -700,6 +699,7 @@ void ssi_buffer_mgr_unmap_aead_request( likely(req->src == req->dst)) { u32 size_to_skip = req->assoclen; + if (areq_ctx->is_gcm4543) size_to_skip += crypto_aead_ivsize(tfm); @@ -1027,6 +1027,7 @@ static inline int ssi_buffer_mgr_prepare_aead_data_mlli( * MAC verification upon request completion */ u32 size_to_skip = req->assoclen; + if (areq_ctx->is_gcm4543) size_to_skip += crypto_aead_ivsize(tfm); diff --git a/drivers/staging/ccree/ssi_buffer_mgr.h b/drivers/staging/ccree/ssi_buffer_mgr.h index bb5f8dc..41f5223 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.h +++ b/drivers/staging/ccree/ssi_buffer_mgr.h @@ -26,7 +26,6 @@ #include "ssi_config.h" #include "ssi_driver.h" - enum ssi_req_dma_buf_type { SSI_DMA_BUF_NULL = 0, SSI_DMA_BUF_DLLI, diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c index eb3e8e6..cd2eafc 100644 --- a/drivers/staging/ccree/ssi_cipher.c +++ b/drivers/staging/ccree/ssi_cipher.c @@ -47,6 +47,7 @@ struct cc_user_key_info { u8 *key; dma_addr_t key_dma_addr; }; + struct cc_hw_key_info { enum cc_hw_crypto_key key1_slot; enum cc_hw_crypto_key key2_slot; @@ -67,7 +68,6 @@ struct ssi_ablkcipher_ctx { static void ssi_ablkcipher_complete(struct device *dev, void *ssi_req, void __iomem *cc_base); - static int validate_keys_sizes(struct ssi_ablkcipher_ctx *ctx_p, u32 size) { switch (ctx_p->flow_mode) { case S_DIN_to_AES: @@ -108,7 +108,6 @@ static int validate_keys_sizes(struct ssi_ablkcipher_ctx *ctx_p, u32 size) { return -EINVAL; } - static int validate_data_size(struct ssi_ablkcipher_ctx *ctx_p, unsigned int size) { switch (ctx_p->flow_mode) { case S_DIN_to_AES: @@ -252,7 +251,6 @@ static void ssi_blkcipher_exit(struct crypto_tfm *tfm) SSI_LOG_DEBUG("Free key buffer in context. key=@%p\n", ctx_p->user.key); } - struct tdes_keys { u8 key1[DES_KEY_SIZE]; u8 key2[DES_KEY_SIZE]; @@ -396,8 +394,6 @@ static int ssi_blkcipher_setkey(struct crypto_tfm *tfm, return -EINVAL; } - - /* STAT_PHASE_1: Copy key to ctx */ dma_sync_single_for_cpu(dev, ctx_p->user.key_dma_addr, max_key_buf_size, DMA_TO_DEVICE); @@ -422,6 +418,7 @@ static int ssi_blkcipher_setkey(struct crypto_tfm *tfm, int key_len = keylen >> 1; int err; SHASH_DESC_ON_STACK(desc, ctx_p->shash_tfm); + desc->tfm = ctx_p->shash_tfm; err = crypto_shash_digest(desc, ctx_p->user.key, key_len, ctx_p->user.key + key_len); @@ -435,7 +432,6 @@ static int ssi_blkcipher_setkey(struct crypto_tfm *tfm, max_key_buf_size, DMA_TO_DEVICE); ctx_p->keylen = keylen; - SSI_LOG_DEBUG("ssi_blkcipher_setkey: return safely"); return 0; } @@ -598,7 +594,6 @@ static inline void ssi_blkcipher_create_multi2_setup_desc( set_setup_mode(&desc[*seq_size], SETUP_LOAD_STATE0); (*seq_size)++; - /* Set state */ hw_desc_init(&desc[*seq_size]); set_din_type(&desc[*seq_size], DMA_DLLI, req_ctx->gen_ctx.iv_dma_addr, @@ -724,7 +719,6 @@ static int ssi_blkcipher_complete(struct device *dev, ssi_buffer_mgr_unmap_blkcipher_request(dev, req_ctx, ivsize, src, dst); - /*Set the inflight couter value to local variable*/ inflight_counter = ctx_p->drvdata->inflight_counter; /*Decrease the inflight counter*/ @@ -790,7 +784,6 @@ static int ssi_blkcipher_process( /* Setup request context */ req_ctx->gen_ctx.op_type = direction; - /* STAT_PHASE_1: Map buffers */ rc = ssi_buffer_mgr_map_blkcipher_request(ctx_p->drvdata, req_ctx, ivsize, nbytes, info, src, dst); @@ -799,7 +792,6 @@ static int ssi_blkcipher_process( goto exit_process; } - /* STAT_PHASE_2: Create sequence */ /* Setup processing */ @@ -878,7 +870,6 @@ static int ssi_ablkcipher_init(struct crypto_tfm *tfm) return ssi_blkcipher_init(tfm); } - static int ssi_ablkcipher_setkey(struct crypto_ablkcipher *tfm, const u8 *key, unsigned int keylen) @@ -911,7 +902,6 @@ static int ssi_ablkcipher_decrypt(struct ablkcipher_request *req) return ssi_blkcipher_process(tfm, req_ctx, req->dst, req->src, req->nbytes, req->info, ivsize, (void *)req, DRV_CRYPTO_DIRECTION_DECRYPT); } - /* DX Block cipher alg */ static struct ssi_alg_template blkcipher_algs[] = { /* Async template */ @@ -1290,6 +1280,7 @@ int ssi_ablkcipher_free(struct ssi_drvdata *drvdata) struct ssi_blkcipher_handle *blkcipher_handle = drvdata->blkcipher_handle; struct device *dev; + dev = &drvdata->plat_dev->dev; if (blkcipher_handle) { @@ -1307,8 +1298,6 @@ int ssi_ablkcipher_free(struct ssi_drvdata *drvdata) return 0; } - - int ssi_ablkcipher_alloc(struct ssi_drvdata *drvdata) { struct ssi_blkcipher_handle *ablkcipher_handle; diff --git a/drivers/staging/ccree/ssi_cipher.h b/drivers/staging/ccree/ssi_cipher.h index 22d7b43..296b375 100644 --- a/drivers/staging/ccree/ssi_cipher.h +++ b/drivers/staging/ccree/ssi_cipher.h @@ -26,7 +26,6 @@ #include "ssi_driver.h" #include "ssi_buffer_mgr.h" - /* Crypto cipher flags */ #define CC_CRYPTO_CIPHER_KEY_KFDE0 (1 << 0) #define CC_CRYPTO_CIPHER_KEY_KFDE1 (1 << 1) @@ -36,7 +35,6 @@ #define CC_CRYPTO_CIPHER_KEY_KFDE_MASK (CC_CRYPTO_CIPHER_KEY_KFDE0 | CC_CRYPTO_CIPHER_KEY_KFDE1 | CC_CRYPTO_CIPHER_KEY_KFDE2 | CC_CRYPTO_CIPHER_KEY_KFDE3) - struct blkcipher_req_ctx { struct async_gen_req_ctx gen_ctx; enum ssi_req_dma_buf_type dma_buf_type; @@ -49,8 +47,6 @@ struct blkcipher_req_ctx { struct mlli_params mlli_params; }; - - int ssi_ablkcipher_alloc(struct ssi_drvdata *drvdata); int ssi_ablkcipher_free(struct ssi_drvdata *drvdata); @@ -63,7 +59,6 @@ int ssi_ablkcipher_free(struct ssi_drvdata *drvdata); CRYPTO_ALG_BULK_DU_4096) #endif /* CRYPTO_ALG_BULK_MASK */ - #ifdef CRYPTO_TFM_REQ_HW_KEY static inline bool ssi_is_hw_key(struct crypto_tfm *tfm) @@ -85,5 +80,4 @@ static inline bool ssi_is_hw_key(struct crypto_tfm *tfm) #endif /* CRYPTO_TFM_REQ_HW_KEY */ - #endif /*__SSI_CIPHER_H__*/ diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging/ccree/ssi_driver.c index 5c1d295..78709b92 100644 --- a/drivers/staging/ccree/ssi_driver.c +++ b/drivers/staging/ccree/ssi_driver.c @@ -73,7 +73,6 @@ #include "ssi_pm.h" #include "ssi_fips_local.h" - #ifdef DX_DUMP_BYTES void dump_byte_array(const char *name, const u8 *the_array, unsigned long size) { @@ -274,7 +273,6 @@ static int init_cc_resources(struct platform_device *plat_dev) SSI_LOG_DEBUG("CC registers mapped from %pa to 0x%p\n", &new_drvdata->res_mem->start, cc_base); new_drvdata->cc_base = cc_base; - /* Then IRQ */ new_drvdata->res_irq = platform_get_resource(plat_dev, IORESOURCE_IRQ, 0); if (unlikely(!new_drvdata->res_irq)) { @@ -546,6 +544,7 @@ static int cc7x_remove(struct platform_device *plat_dev) return 0; } + #if defined(CONFIG_PM_RUNTIME) || defined(CONFIG_PM_SLEEP) static struct dev_pm_ops arm_cc7x_driver_pm = { SET_RUNTIME_PM_OPS(ssi_power_mgr_runtime_suspend, ssi_power_mgr_runtime_resume, NULL) @@ -558,7 +557,6 @@ static struct dev_pm_ops arm_cc7x_driver_pm = { #define DX_DRIVER_RUNTIME_PM NULL #endif - #ifdef CONFIG_OF static const struct of_device_id arm_cc7x_dev_of_match[] = { {.compatible = "arm,cryptocell-712-ree"}, diff --git a/drivers/staging/ccree/ssi_fips.c b/drivers/staging/ccree/ssi_fips.c index d34d9ef..fdc40f3 100644 --- a/drivers/staging/ccree/ssi_fips.c +++ b/drivers/staging/ccree/ssi_fips.c @@ -14,7 +14,6 @@ * along with this program; if not, see . */ - /************************************************************** * This file defines the driver FIPS APIs * **************************************************************/ @@ -22,7 +21,6 @@ #include #include "ssi_fips.h" - extern int ssi_fips_ext_get_state(enum cc_fips_state_t *p_state); extern int ssi_fips_ext_get_error(enum cc_fips_error *p_err); diff --git a/drivers/staging/ccree/ssi_fips.h b/drivers/staging/ccree/ssi_fips.h index ce5fa45..4f5c6a9 100644 --- a/drivers/staging/ccree/ssi_fips.h +++ b/drivers/staging/ccree/ssi_fips.h @@ -29,7 +29,6 @@ enum cc_fips_state { CC_FIPS_STATE_RESERVE32B = S32_MAX }; - enum cc_fips_error { CC_REE_FIPS_ERROR_OK = 0, CC_REE_FIPS_ERROR_GENERAL, @@ -55,8 +54,6 @@ enum cc_fips_error { CC_REE_FIPS_ERROR_RESERVE32B = S32_MAX }; - - int ssi_fips_get_state(enum cc_fips_state *p_state); int ssi_fips_get_error(enum cc_fips_error *p_err); diff --git a/drivers/staging/ccree/ssi_fips_data.h b/drivers/staging/ccree/ssi_fips_data.h index 27b2866..c41671d 100644 --- a/drivers/staging/ccree/ssi_fips_data.h +++ b/drivers/staging/ccree/ssi_fips_data.h @@ -98,14 +98,12 @@ #define NIST_AES_192_CTR_CIPHER { 0x1a, 0xbc, 0x93, 0x24, 0x17, 0x52, 0x1c, 0xa2, 0x4f, 0x2b, 0x04, 0x59, 0xfe, 0x7e, 0x6e, 0x0b } #define NIST_AES_256_CTR_CIPHER { 0x60, 0x1e, 0xc3, 0x13, 0x77, 0x57, 0x89, 0xa5, 0xb7, 0xa7, 0xf5, 0x04, 0xbb, 0xf3, 0xd2, 0x28 } - #define RFC3962_AES_128_KEY { 0x63, 0x68, 0x69, 0x63, 0x6b, 0x65, 0x6e, 0x20, 0x74, 0x65, 0x72, 0x69, 0x79, 0x61, 0x6b, 0x69 } #define RFC3962_AES_VECTOR_SIZE 17 #define RFC3962_AES_PLAIN_DATA { 0x49, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20 } #define RFC3962_AES_CBC_CTS_IV { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } #define RFC3962_AES_128_CBC_CTS_CIPHER { 0xc6, 0x35, 0x35, 0x68, 0xf2, 0xbf, 0x8c, 0xb4, 0xd8, 0xa5, 0x80, 0x36, 0x2d, 0xa7, 0xff, 0x7f, 0x97 } - #define NIST_AES_256_XTS_KEY { 0xa1, 0xb9, 0x0c, 0xba, 0x3f, 0x06, 0xac, 0x35, 0x3b, 0x2c, 0x34, 0x38, 0x76, 0x08, 0x17, 0x62, \ 0x09, 0x09, 0x23, 0x02, 0x6e, 0x91, 0x77, 0x18, 0x15, 0xf2, 0x9d, 0xab, 0x01, 0x93, 0x2f, 0x2f } #define NIST_AES_256_XTS_IV { 0x4f, 0xae, 0xf7, 0x11, 0x7c, 0xda, 0x59, 0xc6, 0x6e, 0x4b, 0x92, 0x01, 0x3e, 0x76, 0x8a, 0xd5 } @@ -124,7 +122,6 @@ #define NIST_AES_512_XTS_CIPHER { 0xcb, 0xaa, 0xd0, 0xe2, 0xf6, 0xce, 0xa3, 0xf5, 0x0b, 0x37, 0xf9, 0x34, 0xd4, 0x6a, 0x9b, 0x13, \ 0x0b, 0x9d, 0x54, 0xf0, 0x7e, 0x34, 0xf3, 0x6a, 0xf7, 0x93, 0xe8, 0x6f, 0x73, 0xc6, 0xd7, 0xdb } - /* NIST AES-CMAC */ #define NIST_AES_128_CMAC_KEY { 0x67, 0x08, 0xc9, 0x88, 0x7b, 0x84, 0x70, 0x84, 0xf1, 0x23, 0xd3, 0xdd, 0x9c, 0x3a, 0x81, 0x36 } #define NIST_AES_128_CMAC_PLAIN_DATA { 0xa8, 0xde, 0x55, 0x17, 0x0c, 0x6d, 0xc0, 0xd8, 0x0d, 0xe3, 0x2f, 0x50, 0x8b, 0xf4, 0x9b, 0x70 } @@ -147,7 +144,6 @@ #define NIST_AES_256_CMAC_VECTOR_SIZE 16 #define NIST_AES_256_CMAC_OUTPUT_SIZE 10 - /* NIST TDES */ #define TDES_NUM_OF_KEYS 3 #define NIST_TDES_VECTOR_SIZE 8 @@ -168,7 +164,6 @@ #define NIST_TDES_CBC3_PLAIN_DATA { 0x3b, 0xb7, 0xa7, 0xdb, 0xa3, 0xd5, 0x92, 0x91 } #define NIST_TDES_CBC3_CIPHER { 0x5b, 0x84, 0x24, 0xd2, 0x39, 0x3e, 0x55, 0xa2 } - /* NIST AES-CCM */ #define NIST_AESCCM_128_BIT_KEY_SIZE 16 #define NIST_AESCCM_192_BIT_KEY_SIZE 24 @@ -207,7 +202,6 @@ #define NIST_AESCCM_256_CIPHER { 0xcc, 0x17, 0xbf, 0x87, 0x94, 0xc8, 0x43, 0x45, 0x7d, 0x89, 0x93, 0x91, 0x89, 0x8e, 0xd2, 0x2a } #define NIST_AESCCM_256_MAC { 0x6f, 0x9d, 0x28, 0xfc, 0xb6, 0x42, 0x34, 0xe1, 0xcd, 0x79, 0x3c, 0x41, 0x44, 0xf1, 0xda, 0x50 } - /* NIST AES-GCM */ #define NIST_AESGCM_128_BIT_KEY_SIZE 16 #define NIST_AESGCM_192_BIT_KEY_SIZE 24 @@ -241,7 +235,6 @@ #define NIST_AESGCM_256_CIPHER { 0x42, 0x6e, 0x0e, 0xfc, 0x69, 0x3b, 0x7b, 0xe1, 0xf3, 0x01, 0x8d, 0xb7, 0xdd, 0xbb, 0x7e, 0x4d } #define NIST_AESGCM_256_MAC { 0xee, 0x82, 0x57, 0x79, 0x5b, 0xe6, 0xa1, 0x16, 0x4d, 0x7e, 0x1d, 0x2d, 0x6c, 0xac, 0x77, 0xa7 } - /* NIST HASH */ #define NIST_SHA_MSG_SIZE 16 @@ -259,7 +252,6 @@ 0x8f, 0x2b, 0xa9, 0x1c, 0x3a, 0x9f, 0x0c, 0x16, 0x53, 0xc4, 0xbf, 0x0a, 0xda, 0x35, 0x64, 0x55, \ 0xea, 0x36, 0xfd, 0x31, 0xf8, 0xe7, 0x3e, 0x39, 0x51, 0xca, 0xd4, 0xeb, 0xba, 0x8c, 0x6e, 0x04 } - /* NIST HMAC */ #define NIST_HMAC_MSG_SIZE 128 diff --git a/drivers/staging/ccree/ssi_fips_ext.c b/drivers/staging/ccree/ssi_fips_ext.c index 295aeb6..e7bf184 100644 --- a/drivers/staging/ccree/ssi_fips_ext.c +++ b/drivers/staging/ccree/ssi_fips_ext.c @@ -23,7 +23,6 @@ #include "ssi_fips_local.h" #include "ssi_driver.h" - static bool tee_error; module_param(tee_error, bool, 0644); MODULE_PARM_DESC(tee_error, "Simulate TEE library failure flag: 0 - no error (default), 1 - TEE error occured "); @@ -91,4 +90,3 @@ int ssi_fips_ext_set_error(enum cc_fips_error err) return 0; } - diff --git a/drivers/staging/ccree/ssi_fips_ll.c b/drivers/staging/ccree/ssi_fips_ll.c index cbb0fe2..3557e20 100644 --- a/drivers/staging/ccree/ssi_fips_ll.c +++ b/drivers/staging/ccree/ssi_fips_ll.c @@ -27,7 +27,6 @@ #include "ssi_hash.h" #include "ssi_request_mgr.h" - static const u32 digest_len_init[] = { 0x00000040, 0x00000000, 0x00000000, 0x00000000 }; static const u32 sha1_init[] = { @@ -43,7 +42,6 @@ static const u64 sha512_init[] = { SHA512_H3, SHA512_H2, SHA512_H1, SHA512_H0 }; #endif - #define NIST_CIPHER_AES_MAX_VECTOR_SIZE 32 struct fips_cipher_ctx { @@ -65,7 +63,6 @@ typedef struct _FipsCipherData { size_t dataInSize; } FipsCipherData; - struct fips_cmac_ctx { u8 key[AES_256_BIT_KEY_SIZE]; u8 din[NIST_CIPHER_AES_MAX_VECTOR_SIZE]; @@ -82,7 +79,6 @@ typedef struct _FipsCmacData { size_t mac_res_size; } FipsCmacData; - struct fips_hash_ctx { u8 initial_digest[CC_DIGEST_SIZE_MAX]; u8 din[NIST_SHA_MSG_SIZE]; @@ -96,7 +92,6 @@ typedef struct _FipsHashData { u8 mac_res[CC_DIGEST_SIZE_MAX]; } FipsHashData; - /* note that the hmac key length must be equal or less than block size (block size is 64 up to sha256 and 128 for sha384/512) */ struct fips_hmac_ctx { u8 initial_digest[CC_DIGEST_SIZE_MAX]; @@ -117,7 +112,6 @@ typedef struct _FipsHmacData { u8 mac_res[CC_DIGEST_SIZE_MAX]; } FipsHmacData; - #define FIPS_CCM_B0_A0_ADATA_SIZE (NIST_AESCCM_IV_SIZE + NIST_AESCCM_IV_SIZE + NIST_AESCCM_ADATA_SIZE) struct fips_ccm_ctx { @@ -144,7 +138,6 @@ typedef struct _FipsCcmData { u8 macResOut[NIST_AESCCM_TAG_SIZE]; } FipsCcmData; - struct fips_gcm_ctx { u8 adata[NIST_AESGCM_ADATA_SIZE]; u8 key[CC_AES_KEY_SIZE_MAX]; @@ -171,7 +164,6 @@ typedef struct _FipsGcmData { u8 macResOut[NIST_AESGCM_TAG_SIZE]; } FipsGcmData; - typedef union _fips_ctx { struct fips_cipher_ctx cipher; struct fips_cmac_ctx cmac; @@ -181,7 +173,6 @@ typedef union _fips_ctx { struct fips_gcm_ctx gcm; } fips_ctx; - /* test data tables */ static const FipsCipherData FipsCipherDataTable[] = { /* AES */ @@ -223,6 +214,7 @@ static const FipsCipherData FipsCipherDataTable[] = { { 0, NIST_TDES_CBC3_KEY, CC_DRV_DES_TRIPLE_KEY_SIZE, NIST_TDES_CBC3_IV, DRV_CRYPTO_DIRECTION_ENCRYPT, DRV_CIPHER_CBC, NIST_TDES_CBC3_PLAIN_DATA, NIST_TDES_CBC3_CIPHER, NIST_TDES_VECTOR_SIZE }, { 0, NIST_TDES_CBC3_KEY, CC_DRV_DES_TRIPLE_KEY_SIZE, NIST_TDES_CBC3_IV, DRV_CRYPTO_DIRECTION_DECRYPT, DRV_CIPHER_CBC, NIST_TDES_CBC3_CIPHER, NIST_TDES_CBC3_PLAIN_DATA, NIST_TDES_VECTOR_SIZE }, }; + #define FIPS_CIPHER_NUM_OF_TESTS (sizeof(FipsCipherDataTable) / sizeof(FipsCipherData)) static const FipsCmacData FipsCmacDataTable[] = { @@ -230,6 +222,7 @@ static const FipsCmacData FipsCmacDataTable[] = { { DRV_CRYPTO_DIRECTION_ENCRYPT, NIST_AES_192_CMAC_KEY, AES_192_BIT_KEY_SIZE, NIST_AES_192_CMAC_PLAIN_DATA, NIST_AES_192_CMAC_VECTOR_SIZE, NIST_AES_192_CMAC_MAC, NIST_AES_192_CMAC_OUTPUT_SIZE }, { DRV_CRYPTO_DIRECTION_ENCRYPT, NIST_AES_256_CMAC_KEY, AES_256_BIT_KEY_SIZE, NIST_AES_256_CMAC_PLAIN_DATA, NIST_AES_256_CMAC_VECTOR_SIZE, NIST_AES_256_CMAC_MAC, NIST_AES_256_CMAC_OUTPUT_SIZE }, }; + #define FIPS_CMAC_NUM_OF_TESTS (sizeof(FipsCmacDataTable) / sizeof(FipsCmacData)) static const FipsHashData FipsHashDataTable[] = { @@ -239,6 +232,7 @@ static const FipsHashData FipsHashDataTable[] = { // { DRV_HASH_SHA512, NIST_SHA_512_MSG, NIST_SHA_MSG_SIZE, NIST_SHA_512_MD }, #endif }; + #define FIPS_HASH_NUM_OF_TESTS (sizeof(FipsHashDataTable) / sizeof(FipsHashData)) static const FipsHmacData FipsHmacDataTable[] = { @@ -248,6 +242,7 @@ static const FipsHmacData FipsHmacDataTable[] = { // { DRV_HASH_SHA512, NIST_HMAC_SHA512_KEY, NIST_HMAC_SHA512_KEY_SIZE, NIST_HMAC_SHA512_MSG, NIST_HMAC_MSG_SIZE, NIST_HMAC_SHA512_MD }, #endif }; + #define FIPS_HMAC_NUM_OF_TESTS (sizeof(FipsHmacDataTable) / sizeof(FipsHmacData)) static const FipsCcmData FipsCcmDataTable[] = { @@ -258,6 +253,7 @@ static const FipsCcmData FipsCcmDataTable[] = { { DRV_CRYPTO_DIRECTION_ENCRYPT, NIST_AESCCM_256_KEY, NIST_AESCCM_256_BIT_KEY_SIZE, NIST_AESCCM_256_NONCE, NIST_AESCCM_256_ADATA, NIST_AESCCM_ADATA_SIZE, NIST_AESCCM_256_PLAIN_TEXT, NIST_AESCCM_TEXT_SIZE, NIST_AESCCM_256_CIPHER, NIST_AESCCM_TAG_SIZE, NIST_AESCCM_256_MAC }, { DRV_CRYPTO_DIRECTION_DECRYPT, NIST_AESCCM_256_KEY, NIST_AESCCM_256_BIT_KEY_SIZE, NIST_AESCCM_256_NONCE, NIST_AESCCM_256_ADATA, NIST_AESCCM_ADATA_SIZE, NIST_AESCCM_256_CIPHER, NIST_AESCCM_TEXT_SIZE, NIST_AESCCM_256_PLAIN_TEXT, NIST_AESCCM_TAG_SIZE, NIST_AESCCM_256_MAC }, }; + #define FIPS_CCM_NUM_OF_TESTS (sizeof(FipsCcmDataTable) / sizeof(FipsCcmData)) static const FipsGcmData FipsGcmDataTable[] = { @@ -268,8 +264,8 @@ static const FipsGcmData FipsGcmDataTable[] = { { DRV_CRYPTO_DIRECTION_ENCRYPT, NIST_AESGCM_256_KEY, NIST_AESGCM_256_BIT_KEY_SIZE, NIST_AESGCM_256_IV, NIST_AESGCM_256_ADATA, NIST_AESGCM_ADATA_SIZE, NIST_AESGCM_256_PLAIN_TEXT, NIST_AESGCM_TEXT_SIZE, NIST_AESGCM_256_CIPHER, NIST_AESGCM_TAG_SIZE, NIST_AESGCM_256_MAC }, { DRV_CRYPTO_DIRECTION_DECRYPT, NIST_AESGCM_256_KEY, NIST_AESGCM_256_BIT_KEY_SIZE, NIST_AESGCM_256_IV, NIST_AESGCM_256_ADATA, NIST_AESGCM_ADATA_SIZE, NIST_AESGCM_256_CIPHER, NIST_AESGCM_TEXT_SIZE, NIST_AESGCM_256_PLAIN_TEXT, NIST_AESGCM_TAG_SIZE, NIST_AESGCM_256_MAC }, }; -#define FIPS_GCM_NUM_OF_TESTS (sizeof(FipsGcmDataTable) / sizeof(FipsGcmData)) +#define FIPS_GCM_NUM_OF_TESTS (sizeof(FipsGcmDataTable) / sizeof(FipsGcmData)) static inline enum cc_fips_error FIPS_CipherToFipsError(enum drv_cipher_mode mode, bool is_aes) @@ -295,7 +291,6 @@ FIPS_CipherToFipsError(enum drv_cipher_mode mode, bool is_aes) return CC_REE_FIPS_ERROR_GENERAL; } - static inline int ssi_cipher_fips_run_test(struct ssi_drvdata *drvdata, bool is_aes, @@ -414,7 +409,6 @@ ssi_cipher_fips_run_test(struct ssi_drvdata *drvdata, return rc; } - enum cc_fips_error ssi_cipher_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, dma_addr_t dma_coherent_buffer) { @@ -479,7 +473,6 @@ ssi_cipher_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffe return error; } - static inline int ssi_cmac_fips_run_test(struct ssi_drvdata *drvdata, dma_addr_t key_dma_addr, @@ -519,7 +512,6 @@ ssi_cmac_fips_run_test(struct ssi_drvdata *drvdata, set_flow_mode(&desc[idx], S_DIN_to_AES); idx++; - //ssi_hash_create_data_desc(state, ctx, DIN_AES_DOUT, desc, false, &idx); hw_desc_init(&desc[idx]); set_din_type(&desc[idx], DMA_DLLI, din_dma_addr, din_len, NS_BIT); @@ -603,7 +595,6 @@ ssi_cmac_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, return error; } - static inline enum cc_fips_error FIPS_HashToFipsError(enum drv_hash_mode hash_mode) { @@ -779,7 +770,6 @@ ssi_hash_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, return error; } - static inline enum cc_fips_error FIPS_HmacToFipsError(enum drv_hash_mode hash_mode) { @@ -867,7 +857,6 @@ ssi_hmac_fips_run_test(struct ssi_drvdata *drvdata, set_setup_mode(&desc[idx], SETUP_LOAD_STATE0); idx++; - /* Load the hash current length*/ hw_desc_init(&desc[idx]); set_cipher_mode(&desc[idx], hw_mode); @@ -981,7 +970,6 @@ ssi_hmac_fips_run_test(struct ssi_drvdata *drvdata, set_flow_mode(&desc[idx], DIN_HASH); idx++; - /* Get final MAC result */ hw_desc_init(&desc[idx]); set_cipher_mode(&desc[idx], hw_mode); @@ -1112,7 +1100,6 @@ ssi_hmac_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, return error; } - static inline int ssi_ccm_fips_run_test(struct ssi_drvdata *drvdata, enum drv_crypto_direction direction, @@ -1277,6 +1264,7 @@ ssi_ccm_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, { /* build B0 -- B0, nonce, l(m) */ __be16 data = cpu_to_be16(NIST_AESCCM_TEXT_SIZE); + virt_ctx->b0_a0_adata[0] = NIST_AESCCM_B0_VAL; memcpy(virt_ctx->b0_a0_adata + 1, ccmData->nonce, NIST_AESCCM_NONCE_SIZE); memcpy(virt_ctx->b0_a0_adata + 14, (u8 *)&data, sizeof(__be16)); @@ -1340,7 +1328,6 @@ ssi_ccm_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, return error; } - static inline int ssi_gcm_fips_run_test(struct ssi_drvdata *drvdata, enum drv_crypto_direction direction, @@ -1439,8 +1426,6 @@ ssi_gcm_fips_run_test(struct ssi_drvdata *drvdata, set_setup_mode(&desc[idx], SETUP_LOAD_STATE0); idx++; - - ///////////////////////////////// 2 //////////////////////////////////// /* prcess(ghash) assoc data */ // if (req->assoclen > 0) @@ -1452,7 +1437,6 @@ ssi_gcm_fips_run_test(struct ssi_drvdata *drvdata, set_flow_mode(&desc[idx], DIN_HASH); idx++; - ///////////////////////////////// 3 //////////////////////////////////// // ssi_aead_gcm_setup_gctr_desc(req, desc, seq_size); ///////////////////////////////// 3 //////////////////////////////////// @@ -1478,7 +1462,6 @@ ssi_gcm_fips_run_test(struct ssi_drvdata *drvdata, set_flow_mode(&desc[idx], S_DIN_to_AES); idx++; - ///////////////////////////////// 4 //////////////////////////////////// /* process(gctr+ghash) */ // if (req_ctx->cryptlen != 0) @@ -1491,7 +1474,6 @@ ssi_gcm_fips_run_test(struct ssi_drvdata *drvdata, set_flow_mode(&desc[idx], cipher_flow_mode); idx++; - ///////////////////////////////// 5 //////////////////////////////////// // ssi_aead_process_gcm_result_desc(req, desc, seq_size); ///////////////////////////////// 5 //////////////////////////////////// @@ -1579,6 +1561,7 @@ ssi_gcm_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, /* len_block */ { __be64 len_bits; + len_bits = cpu_to_be64(gcmData->adataSize * 8); memcpy(virt_ctx->len_block, &len_bits, sizeof(len_bits)); len_bits = cpu_to_be64(gcmData->dataInSize * 8); @@ -1587,6 +1570,7 @@ ssi_gcm_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, /* iv_inc1, iv_inc2 */ { __be32 counter = cpu_to_be32(1); + memcpy(virt_ctx->iv_inc1, gcmData->iv, NIST_AESGCM_IV_SIZE); memcpy(virt_ctx->iv_inc1 + NIST_AESGCM_IV_SIZE, &counter, sizeof(counter)); counter = cpu_to_be32(2); @@ -1651,7 +1635,6 @@ ssi_gcm_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, return error; } - size_t ssi_fips_max_mem_alloc_size(void) { FIPS_DBG("sizeof(struct fips_cipher_ctx) %d \n", sizeof(struct fips_cipher_ctx)); diff --git a/drivers/staging/ccree/ssi_fips_local.c b/drivers/staging/ccree/ssi_fips_local.c index 9b84876..aefb71d 100644 --- a/drivers/staging/ccree/ssi_fips_local.c +++ b/drivers/staging/ccree/ssi_fips_local.c @@ -26,7 +26,6 @@ #include "ssi_driver.h" #include "cc_hal.h" - #define FIPS_POWER_UP_TEST_CIPHER 1 #define FIPS_POWER_UP_TEST_CMAC 1 #define FIPS_POWER_UP_TEST_HASH 1 @@ -49,7 +48,6 @@ struct ssi_fips_handle { #endif }; - extern int ssi_fips_get_state(enum cc_fips_state_t *p_state); extern int ssi_fips_get_error(enum cc_fips_error *p_err); extern int ssi_fips_ext_set_state(enum cc_fips_state_t state); @@ -64,7 +62,6 @@ extern enum cc_fips_error ssi_ccm_fips_power_up_tests(struct ssi_drvdata *drvdat extern enum cc_fips_error ssi_gcm_fips_power_up_tests(struct ssi_drvdata *drvdata, void *cpu_addr_buffer, dma_addr_t dma_coherent_buffer); extern size_t ssi_fips_max_mem_alloc_size(void); - /* The function called once at driver entry point to check whether TEE FIPS error occured.*/ static enum ssi_fips_error ssi_fips_get_tee_error(struct ssi_drvdata *drvdata) { @@ -78,7 +75,6 @@ static enum ssi_fips_error ssi_fips_get_tee_error(struct ssi_drvdata *drvdata) return CC_REE_FIPS_ERROR_FROM_TEE; } - /* * This function should push the FIPS REE library status towards the TEE library. * By writing the error state to HOST_GPR0 register. The function is called from @@ -87,14 +83,13 @@ static enum ssi_fips_error ssi_fips_get_tee_error(struct ssi_drvdata *drvdata) static void ssi_fips_update_tee_upon_ree_status(struct ssi_drvdata *drvdata, enum cc_fips_error err) { void __iomem *cc_base = drvdata->cc_base; + if (err == CC_REE_FIPS_ERROR_OK) CC_HAL_WRITE_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_GPR0), (CC_FIPS_SYNC_REE_STATUS | CC_FIPS_SYNC_MODULE_OK)); else CC_HAL_WRITE_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_GPR0), (CC_FIPS_SYNC_REE_STATUS | CC_FIPS_SYNC_MODULE_ERROR)); } - - void ssi_fips_fini(struct ssi_drvdata *drvdata) { struct ssi_fips_handle *fips_h = drvdata->fips_handle; @@ -127,8 +122,6 @@ void fips_handler(struct ssi_drvdata *drvdata) #endif } - - #ifdef COMP_IN_WQ static void fips_wq_handler(struct work_struct *work) { @@ -161,7 +154,6 @@ static void fips_dsr(unsigned long devarg) CC_REG_OFFSET(HOST_RGF, HOST_IMR)) & ~irq); } - enum cc_fips_error cc_fips_run_power_up_tests(struct ssi_drvdata *drvdata) { enum cc_fips_error fips_error = CC_REE_FIPS_ERROR_OK; @@ -227,8 +219,6 @@ enum cc_fips_error cc_fips_run_power_up_tests(struct ssi_drvdata *drvdata) return fips_error; } - - /* The function checks if FIPS supported and FIPS error exists.* * It should be used in every driver API. */ @@ -247,7 +237,6 @@ int ssi_fips_check_fips_error(void) return 0; } - /* The function sets the REE FIPS state.* * It should be used while driver is being loaded. */ @@ -293,7 +282,6 @@ int ssi_fips_set_error(struct ssi_drvdata *p_drvdata, enum cc_fips_error err) return rc; } - /* The function called once at driver entry point .*/ int ssi_fips_init(struct ssi_drvdata *p_drvdata) { diff --git a/drivers/staging/ccree/ssi_fips_local.h b/drivers/staging/ccree/ssi_fips_local.h index 4bc7f37..8c7994f 100644 --- a/drivers/staging/ccree/ssi_fips_local.h +++ b/drivers/staging/ccree/ssi_fips_local.h @@ -17,7 +17,6 @@ #ifndef __SSI_FIPS_LOCAL_H__ #define __SSI_FIPS_LOCAL_H__ - #ifdef CONFIG_CCX7REE_FIPS_SUPPORT #include "ssi_fips.h" @@ -28,11 +27,13 @@ struct ssi_drvdata; return -ENOEXEC;\ } \ } + #define CHECK_AND_RETURN_VOID_UPON_FIPS_ERROR() {\ if (ssi_fips_check_fips_error() != 0) {\ return;\ } \ } + #define SSI_FIPS_INIT(p_drvData) (ssi_fips_init(p_drvData)) #define SSI_FIPS_FINI(p_drvData) (ssi_fips_fini(p_drvData)) @@ -62,6 +63,5 @@ void fips_handler(struct ssi_drvdata *drvdata); #endif /* CONFIG_CC7XXREE_FIPS_SUPPORT */ - #endif /*__SSI_FIPS_LOCAL_H__*/ diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index 79655bb..ae8f36a 100644 --- a/drivers/staging/ccree/ssi_hash.c +++ b/drivers/staging/ccree/ssi_hash.c @@ -83,7 +83,6 @@ struct ssi_hash_alg { struct ahash_alg ahash_alg; }; - struct hash_key_req_ctx { u32 keylen; dma_addr_t key_dma_addr; @@ -97,6 +96,7 @@ struct ssi_hash_ctx { */ u8 digest_buff[SSI_MAX_HASH_DIGEST_SIZE] ____cacheline_aligned; u8 opad_tmp_keys_buff[SSI_MAX_HASH_OPAD_TMP_KEYS_SIZE] ____cacheline_aligned; + dma_addr_t opad_tmp_keys_dma_addr ____cacheline_aligned; dma_addr_t digest_buff_dma_addr; /* use for hmac with key large then mode block size */ @@ -429,7 +429,6 @@ static int ssi_hash_digest(struct ahash_req_ctx *state, int idx = 0; int rc = 0; - SSI_LOG_DEBUG("===== %s-digest (%d) ====\n", is_hmac ? "hmac" : "hash", nbytes); CHECK_AND_RETURN_UPON_FIPS_ERROR(); @@ -962,6 +961,7 @@ ctx->drvdata, ctx->hash_mode), HASH_LEN_SIZE); static int ssi_hash_init(struct ahash_req_ctx *state, struct ssi_hash_ctx *ctx) { struct device *dev = &ctx->drvdata->plat_dev->dev; + state->xcbc_count = 0; CHECK_AND_RETURN_UPON_FIPS_ERROR(); @@ -1164,7 +1164,6 @@ static int ssi_hash_setkey(void *hash, return rc; } - static int ssi_xcbc_setkey(struct crypto_ahash *ahash, const u8 *key, unsigned int keylen) { @@ -1252,11 +1251,13 @@ static int ssi_xcbc_setkey(struct crypto_ahash *ahash, return rc; } + #if SSI_CC_HAS_CMAC static int ssi_cmac_setkey(struct crypto_ahash *ahash, const u8 *key, unsigned int keylen) { struct ssi_hash_ctx *ctx = crypto_ahash_ctx(ahash); + SSI_LOG_DEBUG("===== setkey (%d) ====\n", keylen); CHECK_AND_RETURN_UPON_FIPS_ERROR(); @@ -1289,7 +1290,6 @@ static int ssi_cmac_setkey(struct crypto_ahash *ahash, ctx->key_params.keylen = keylen; - return 0; } #endif @@ -1319,7 +1319,6 @@ static void ssi_hash_free_ctx(struct ssi_hash_ctx *ctx) ctx->key_params.keylen = 0; } - static int ssi_hash_alloc_ctx(struct ssi_hash_ctx *ctx) { struct device *dev = &ctx->drvdata->plat_dev->dev; @@ -1365,7 +1364,6 @@ static int ssi_ahash_cra_init(struct crypto_tfm *tfm) struct ssi_hash_alg *ssi_alg = container_of(ahash_alg, struct ssi_hash_alg, ahash_alg); - CHECK_AND_RETURN_UPON_FIPS_ERROR(); crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), sizeof(struct ahash_req_ctx)); @@ -1462,7 +1460,6 @@ static int ssi_mac_final(struct ahash_request *req) u32 rem_cnt = state->buff_index ? state->buff1_cnt : state->buff0_cnt; - CHECK_AND_RETURN_UPON_FIPS_ERROR(); if (ctx->hw_mode == DRV_CIPHER_XCBC_MAC) { keySize = CC_AES_128_BIT_KEY_SIZE; @@ -1501,7 +1498,6 @@ static int ssi_mac_final(struct ahash_request *req) set_setup_mode(&desc[idx], SETUP_LOAD_KEY0); idx++; - /* Initiate decryption of block state to previous block_state-XOR-M[n] */ hw_desc_init(&desc[idx]); set_din_type(&desc[idx], DMA_DLLI, state->digest_buff_dma_addr, diff --git a/drivers/staging/ccree/ssi_ivgen.c b/drivers/staging/ccree/ssi_ivgen.c index a275151..5ff3368 100644 --- a/drivers/staging/ccree/ssi_ivgen.c +++ b/drivers/staging/ccree/ssi_ivgen.c @@ -296,4 +296,3 @@ int ssi_ivgen_getiv( return 0; } - diff --git a/drivers/staging/ccree/ssi_ivgen.h b/drivers/staging/ccree/ssi_ivgen.h index d466124..961aea4 100644 --- a/drivers/staging/ccree/ssi_ivgen.h +++ b/drivers/staging/ccree/ssi_ivgen.h @@ -19,7 +19,6 @@ #include "cc_hw_queue_defs.h" - #define SSI_IVPOOL_SEQ_LEN 8 /*! diff --git a/drivers/staging/ccree/ssi_pm.c b/drivers/staging/ccree/ssi_pm.c index d3ddfb1..52a8ed5 100644 --- a/drivers/staging/ccree/ssi_pm.c +++ b/drivers/staging/ccree/ssi_pm.c @@ -14,7 +14,6 @@ * along with this program; if not, see . */ - #include "ssi_config.h" #include #include @@ -30,13 +29,11 @@ #include "ssi_hash.h" #include "ssi_pm.h" - #if defined(CONFIG_PM_RUNTIME) || defined(CONFIG_PM_SLEEP) #define POWER_DOWN_ENABLE 0x01 #define POWER_DOWN_DISABLE 0x00 - int ssi_power_mgr_runtime_suspend(struct device *dev) { struct ssi_drvdata *drvdata = @@ -119,8 +116,6 @@ int ssi_power_mgr_runtime_put_suspend(struct device *dev) #endif - - int ssi_power_mgr_init(struct ssi_drvdata *drvdata) { int rc = 0; diff --git a/drivers/staging/ccree/ssi_pm.h b/drivers/staging/ccree/ssi_pm.h index 4874987..63673f6 100644 --- a/drivers/staging/ccree/ssi_pm.h +++ b/drivers/staging/ccree/ssi_pm.h @@ -20,14 +20,11 @@ #ifndef __SSI_POWER_MGR_H__ #define __SSI_POWER_MGR_H__ - #include "ssi_config.h" #include "ssi_driver.h" - #define SSI_SUSPEND_TIMEOUT 3000 - int ssi_power_mgr_init(struct ssi_drvdata *drvdata); void ssi_power_mgr_fini(struct ssi_drvdata *drvdata); diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index f6f7ea8..46d9396 100644 --- a/drivers/staging/ccree/ssi_request_mgr.c +++ b/drivers/staging/ccree/ssi_request_mgr.c @@ -50,6 +50,7 @@ struct ssi_request_mgr_handle { u8 *dummy_comp_buff; dma_addr_t dummy_comp_buff_dma; struct cc_hw_desc monitor_desc; + volatile unsigned long monitor_lock; #ifdef COMP_IN_WQ struct workqueue_struct *workq; @@ -135,7 +136,6 @@ int request_mgr_init(struct ssi_drvdata *drvdata) req_mgr_h->min_free_hw_slots = req_mgr_h->hw_queue_size; req_mgr_h->max_used_sw_slots = 0; - /* Allocate DMA word for "dummy" completion descriptor use */ req_mgr_h->dummy_comp_buff = dma_alloc_coherent(&drvdata->plat_dev->dev, sizeof(u32), &req_mgr_h->dummy_comp_buff_dma, GFP_KERNEL); @@ -192,10 +192,10 @@ static inline void enqueue_seq( static void request_mgr_complete(struct device *dev, void *dx_compl_h, void __iomem *cc_base) { struct completion *this_compl = dx_compl_h; + complete(this_compl); } - static inline int request_mgr_queues_status_check( struct ssi_request_mgr_handle *req_mgr_h, void __iomem *cc_base, @@ -389,7 +389,6 @@ int send_request( } } - /*! * Enqueue caller request to crypto hardware during init process. * assume this function is not called in middle of a flow, @@ -426,7 +425,6 @@ int send_request_init( return 0; } - void complete_request(struct ssi_drvdata *drvdata) { struct ssi_request_mgr_handle *request_mgr_handle = @@ -478,6 +476,7 @@ static void proc_completions(struct ssi_drvdata *drvdata) { u32 axi_err; int i; + SSI_LOG_INFO("Delay\n"); for (i = 0; i < 1000000; i++) axi_err = READ_REGISTER(drvdata->cc_base + CC_REG_OFFSET(CRY_KERNEL, AXIM_MON_ERR)); @@ -516,8 +515,6 @@ static void comp_handler(unsigned long devarg) u32 irq; - - irq = (drvdata->irq & SSI_COMP_IRQ_MASK); if (irq & SSI_COMP_IRQ_MASK) { diff --git a/drivers/staging/ccree/ssi_sram_mgr.c b/drivers/staging/ccree/ssi_sram_mgr.c index cf03df3..e05c0c1 100644 --- a/drivers/staging/ccree/ssi_sram_mgr.c +++ b/drivers/staging/ccree/ssi_sram_mgr.c @@ -17,7 +17,6 @@ #include "ssi_driver.h" #include "ssi_sram_mgr.h" - /** * struct ssi_sram_mgr_ctx -Internal RAM context manager * @sram_free_offset: the offset to the non-allocated area @@ -26,7 +25,6 @@ struct ssi_sram_mgr_ctx { ssi_sram_addr_t sram_free_offset; }; - /** * ssi_sram_mgr_fini() - Cleanup SRAM pool. * diff --git a/drivers/staging/ccree/ssi_sram_mgr.h b/drivers/staging/ccree/ssi_sram_mgr.h index ece6359..9ba1d59 100644 --- a/drivers/staging/ccree/ssi_sram_mgr.h +++ b/drivers/staging/ccree/ssi_sram_mgr.h @@ -17,7 +17,6 @@ #ifndef __SSI_SRAM_MGR_H__ #define __SSI_SRAM_MGR_H__ - #ifndef SSI_CC_SRAM_SIZE #define SSI_CC_SRAM_SIZE 4096 #endif diff --git a/drivers/staging/ccree/ssi_sysfs.c b/drivers/staging/ccree/ssi_sysfs.c index 75c9a89..dbcd163 100644 --- a/drivers/staging/ccree/ssi_sysfs.c +++ b/drivers/staging/ccree/ssi_sysfs.c @@ -108,7 +108,6 @@ static DEFINE_SPINLOCK(stat_lock); static struct stat_item stat_host_db[MAX_STAT_OP_TYPES][MAX_STAT_PHASES]; static struct stat_item stat_cc_db[MAX_STAT_OP_TYPES][MAX_STAT_PHASES]; - static void init_db(struct stat_item item[MAX_STAT_OP_TYPES][MAX_STAT_PHASES]) { unsigned int i, j; @@ -152,7 +151,6 @@ static void display_db(struct stat_item item[MAX_STAT_OP_TYPES][MAX_STAT_PHASES] } } - /************************************** * Attributes show functions section * **************************************/ @@ -278,8 +276,6 @@ void display_all_stat_db(void) } #endif /*CC_CYCLE_COUNT*/ - - static ssize_t ssi_sys_regdump_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { diff --git a/drivers/staging/ccree/ssi_sysfs.h b/drivers/staging/ccree/ssi_sysfs.h index 4893e01..44ae3d4 100644 --- a/drivers/staging/ccree/ssi_sysfs.h +++ b/drivers/staging/ccree/ssi_sysfs.h @@ -36,6 +36,7 @@ enum stat_phase { STAT_PHASE_6, MAX_STAT_PHASES, }; + enum stat_op { STAT_OP_TYPE_NULL = 0, STAT_OP_TYPE_ENCODE, From patchwork Tue Jun 27 07:27:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 106395 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp907317qge; Tue, 27 Jun 2017 00:29:12 -0700 (PDT) X-Received: by 10.98.113.65 with SMTP id m62mr3922019pfc.150.1498548552466; Tue, 27 Jun 2017 00:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498548552; cv=none; d=google.com; s=arc-20160816; b=ett1YBvS7aA6DSXNIGLVxJvcI7IhUI+T/GnL4M9WFylsGKqZ+QnSy9fepZ+7l445wv sa5qOEOIimINCnalJPyYT2X5LP0s7QYYfpAnZmDPFQxjMh6UHi/Y9hroaCCL3Osucq8F WR76nHzkUj4wLzProOnZ5H0IE8b63lsKO2h56J0CQC4ZbKElGTl0JGtEhrAFK9teRVmS zqdHydByUTUHgPro+KcsO6NkawEUruX+xU+ICziTPJksJdrTbvbhweWB0zBiti0dwrll gkA36MfaTwOvBOgqdGM5fQeQZ7Lrojy3Ko0j42uXB7j3MV79xiHYWNtMmXm97XVCHcPQ WLuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=CvfNItwsXBvV3xU5qMYoshroDhQqjLv6+I/geNQBQmU=; b=wQEIFrWIIOHM+7lO2xR2TIdJJ8COYfNBXJiU0K3jHNfU7LRP34kYuDw659/ZT7qdSO ITY4rn1pyExt4w3k+SHaPLO97jPomfGTbwgZgIOV9349iLy+y4gxXzmi1A1YLQtDEyVf wxmrGTBzS0A3yrHGKfzmP0JTiuE72Wmndvh9WDnNWmvj1RY9dgF7JfCso0i3tQK1n9j1 7BWCOw5b4KU0DBxJ2LKTjrL1Yyzu708RfQJssY3Unjn65JIqEz5YrDpTCy93S/3Bj+RZ q7JnkNOqeqlOGc9bgYS8nWzuZDXlXAnCTuPN7gFHmDti84nbeZ+XEEYEX+42ILg1gEl7 oMIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 s62si1439176pgb.247.2017.06.27.00.29.12; Tue, 27 Jun 2017 00:29:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752133AbdF0H3K (ORCPT + 1 other); Tue, 27 Jun 2017 03:29:10 -0400 Received: from foss.arm.com ([217.140.101.70]:52548 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752580AbdF0H2x (ORCPT ); Tue, 27 Jun 2017 03:28:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F15B8344; Tue, 27 Jun 2017 00:28:52 -0700 (PDT) Received: from gby.kfn.arm.com (unknown [10.45.48.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6F8C53F4FF; Tue, 27 Jun 2017 00:28:51 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ofir Drang Subject: [PATCH 14/14] staging: ccree: fix block comment style Date: Tue, 27 Jun 2017 10:27:26 +0300 Message-Id: <1498548449-10803-15-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498548449-10803-1-git-send-email-gilad@benyossef.com> References: <1498548449-10803-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Align block comments according to coding style. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/cc_hw_queue_defs.h b/drivers/staging/ccree/cc_hw_queue_defs.h index f11487a..e6b8cea 100644 --- a/drivers/staging/ccree/cc_hw_queue_defs.h +++ b/drivers/staging/ccree/cc_hw_queue_defs.h @@ -23,8 +23,8 @@ #include /****************************************************************************** -* DEFINITIONS -******************************************************************************/ + * DEFINITIONS + ******************************************************************************/ #define HW_DESC_SIZE_WORDS 6 #define HW_QUEUE_SLOTS_MAX 15 /* Max. available slots in HW queue */ @@ -70,8 +70,8 @@ #define WORD5_DOUT_ADDR_HIGH CC_GENMASK(5, DOUT_ADDR_HIGH) /****************************************************************************** -* TYPE DEFINITIONS -******************************************************************************/ + * TYPE DEFINITIONS + ******************************************************************************/ struct cc_hw_desc { union {