From patchwork Wed May 24 04:46:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Robson X-Patchwork-Id: 9745011 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8FC9B6032B for ; Wed, 24 May 2017 04:46:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8458F288C5 for ; Wed, 24 May 2017 04:46:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79309288C7; Wed, 24 May 2017 04:46:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD7E1288C5 for ; Wed, 24 May 2017 04:46:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965974AbdEXEqo (ORCPT ); Wed, 24 May 2017 00:46:44 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34016 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933407AbdEXEqm (ORCPT ); Wed, 24 May 2017 00:46:42 -0400 Received: by mail-pg0-f68.google.com with SMTP id u187so15648295pgb.1; Tue, 23 May 2017 21:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=/MA0hegPGpc87ZE+3wyEYTyNgO7VTk9Dt3OJVNAEOmg=; b=Ro9tYofTz6fOQ8zL3Kvx0PGDkqknX3/1sAHsSER3jt97Hv1QFHTGe+UNV1WePnQBgW 1IcZG1Gdw+foZLIW6QsMrBuH+0i/Y8Ps1oD1CL0IbAeXLVtywfMp+dEY4VDa7qkN3Gws Ng0/bXHekrJyjB9/kn6j5OtpW+b9ZKQbHz3m4KE51znGBTzTODEQTToPnNUDjnsmRjpD DCPFDfbPiqZ/qxwK8BM60SHaQAWRzWaGEEYxhZes2RDoQW68C6eG9T9O0JsB+yqmXQ1n hsMgo1udoT3Zfldwb+YpC2bbc8flePt4RObHkibVVivR9r9CxcIL98DfJGdHnQGy02jW hcYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/MA0hegPGpc87ZE+3wyEYTyNgO7VTk9Dt3OJVNAEOmg=; b=NSWL/HTYzqp4hX24DNht0TR28DcPBLeGAZm/3UDBfPOrGcPIZg1KZIM7t2+Sb7fV45 eN1Asgd79jGJQtn48/kF9n+fIeFtuq+i2JaNtvOALbJPXBO//UQ6Wt/lzShfa7qlIPNQ YL2xPEBzhqiYFap6gkwyqu6eWXYX/EKWhXxbBbdE2tuqg+A7XpTi7Ey2bonYllVVj4Dx ZS8fg7OcG2H8T9moDP0tza9k/Q70x8d/cyWrV1lk4lbFNSMCgUptb8wPSLU9fgD+TtrR ki2XouymyYzCXXtEfJPoHC+DdorLNis+O2fgx01GiCAoWOP38KOBKK9vC2If8Vd3JtIQ N32Q== X-Gm-Message-State: AODbwcCAhDzHm99sxPSsmolvbkii6e7JrnMUHlnlFTcmn68lmXXEDrxs 3I0CIJXqg1ZAmKr/fSr4aQ== X-Received: by 10.99.54.141 with SMTP id d135mr17968110pga.85.1495601191653; Tue, 23 May 2017 21:46:31 -0700 (PDT) Received: from localhost.localdomain (121-75-114-245.dyn.vf.net.nz. [121.75.114.245]) by smtp.gmail.com with ESMTPSA id b126sm5215389pga.3.2017.05.23.21.46.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 May 2017 21:46:31 -0700 (PDT) From: Derek Robson To: gilad@benyossef.com, gregkh@linuxfoundation.org Cc: linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Derek Robson Subject: [PATCH 21/27] Drivers: ccree: ssi_buffer_mgr.c - align block comments Date: Wed, 24 May 2017 16:46:23 +1200 Message-Id: <20170524044623.30840-1-robsonde@gmail.com> X-Mailer: git-send-email 2.12.2 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_buffer_mgr.c | 87 +++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 38 deletions(-) diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index 77e490968db9..db6333ae5612 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.c +++ b/drivers/staging/ccree/ssi_buffer_mgr.c @@ -330,7 +330,8 @@ static int ssi_buffer_mgr_generate_mlli( /* set last bit in the current table */ if (sg_data->mlli_nents[i] != NULL) { /*Calculate the current MLLI table length for the - length field in the descriptor*/ + *length field in the descriptor + */ *(sg_data->mlli_nents[i]) += (total_nents - prev_total_nents); prev_total_nents = total_nents; @@ -463,7 +464,8 @@ static int ssi_buffer_mgr_map_scatterlist( } if (!is_chained) { /* In case of mmu the number of mapped nents might - be changed from the original sgl nents */ + * be changed from the original sgl nents + */ *mapped_nents = dma_map_sg(dev, sg, *nents, direction); if (unlikely(*mapped_nents == 0)){ *nents = 0; @@ -472,7 +474,8 @@ static int ssi_buffer_mgr_map_scatterlist( } } else { /*In this case the driver maps entry by entry so it - must have the same nents before and after map */ + * must have the same nents before and after map + */ *mapped_nents = ssi_buffer_mgr_dma_map_sg(dev, sg, *nents, @@ -764,7 +767,8 @@ void ssi_buffer_mgr_unmap_aead_request( } /*In case a pool was set, a table was - allocated and should be released */ + *allocated and should be released + */ if (areq_ctx->mlli_params.curr_pool != NULL) { SSI_LOG_DEBUG("free MLLI buffer: dma=0x%08llX virt=%pK\n", (unsigned long long)areq_ctx->mlli_params.mlli_dma_addr, @@ -801,7 +805,8 @@ void ssi_buffer_mgr_unmap_aead_request( size_to_skip += crypto_aead_ivsize(tfm); } /* copy mac to a temporary location to deal with possible - data memory overriding that caused by cache coherence problem. */ + * data memory overriding that caused by cache coherence problem. + */ ssi_buffer_mgr_copy_scatterlist_portion( areq_ctx->backup_mac, req->src, size_to_skip+ req->cryptlen - areq_ctx->req_authsize, @@ -965,7 +970,8 @@ static inline int ssi_buffer_mgr_aead_chain_assoc( areq_ctx->assoc.nents = mapped_nents; /* in CCM case we have additional entry for - * ccm header configurations */ + * ccm header configurations + */ if (areq_ctx->ccm_hdr_size != ccm_header_size_null) { if (unlikely((mapped_nents + 1) > LLI_MAX_NUM_OF_ASSOC_DATA_ENTRIES)) { @@ -1068,13 +1074,15 @@ static inline int ssi_buffer_mgr_prepare_aead_data_mlli( if (unlikely(areq_ctx->is_icv_fragmented == true)) { /* Backup happens only when ICV is fragmented, ICV - verification is made by CPU compare in order to simplify - MAC verification upon request completion */ + * verification is made by CPU compare in order to simplify + * MAC verification upon request completion + */ if (direct == DRV_CRYPTO_DIRECTION_DECRYPT) { #if !DX_HAS_ACP /* In ACP platform we already copying ICV - for any INPLACE-DECRYPT operation, hence - we must neglect this code. */ + * for any INPLACE-DECRYPT operation, hence + * we must neglect this code. + */ u32 size_to_skip = req->assoclen; if (areq_ctx->is_gcm4543) { size_to_skip += crypto_aead_ivsize(tfm); @@ -1120,8 +1128,9 @@ static inline int ssi_buffer_mgr_prepare_aead_data_mlli( if (unlikely(areq_ctx->is_icv_fragmented == true)) { /* Backup happens only when ICV is fragmented, ICV - verification is made by CPU compare in order to simplify - MAC verification upon request completion */ + * verification is made by CPU compare in order to simplify + * MAC verification upon request completion + */ u32 size_to_skip = req->assoclen; if (areq_ctx->is_gcm4543) { size_to_skip += crypto_aead_ivsize(tfm); @@ -1378,7 +1387,8 @@ int ssi_buffer_mgr_map_aead_request( size_to_skip += crypto_aead_ivsize(tfm); } /* copy mac to a temporary location to deal with possible - data memory overriding that caused by cache coherence problem. */ + * data memory overriding that caused by cache coherence problem. + */ ssi_buffer_mgr_copy_scatterlist_portion( areq_ctx->backup_mac, req->src, size_to_skip+ req->cryptlen - areq_ctx->req_authsize, @@ -1494,11 +1504,11 @@ int ssi_buffer_mgr_map_aead_request( if (likely(areq_ctx->is_single_pass == true)) { /* - * Create MLLI table for: - * (1) Assoc. data - * (2) Src/Dst SGLs - * Note: IV is contg. buffer (not an SGL) - */ + * Create MLLI table for: + * (1) Assoc. data + * (2) Src/Dst SGLs + * Note: IV is contg. buffer (not an SGL) + */ rc = ssi_buffer_mgr_aead_chain_assoc(drvdata, req, &sg_data, true, false); if (unlikely(rc != 0)) goto aead_map_failure; @@ -1510,25 +1520,25 @@ int ssi_buffer_mgr_map_aead_request( goto aead_map_failure; } else { /* DOUBLE-PASS flow */ /* - * Prepare MLLI table(s) in this order: - * - * If ENCRYPT/DECRYPT (inplace): - * (1) MLLI table for assoc - * (2) IV entry (chained right after end of assoc) - * (3) MLLI for src/dst (inplace operation) - * - * If ENCRYPT (non-inplace) - * (1) MLLI table for assoc - * (2) IV entry (chained right after end of assoc) - * (3) MLLI for dst - * (4) MLLI for src - * - * If DECRYPT (non-inplace) - * (1) MLLI table for assoc - * (2) IV entry (chained right after end of assoc) - * (3) MLLI for src - * (4) MLLI for dst - */ + * Prepare MLLI table(s) in this order: + * + * If ENCRYPT/DECRYPT (inplace): + * (1) MLLI table for assoc + * (2) IV entry (chained right after end of assoc) + * (3) MLLI for src/dst (inplace operation) + * + * If ENCRYPT (non-inplace) + * (1) MLLI table for assoc + * (2) IV entry (chained right after end of assoc) + * (3) MLLI for dst + * (4) MLLI for src + * + * If DECRYPT (non-inplace) + * (1) MLLI table for assoc + * (2) IV entry (chained right after end of assoc) + * (3) MLLI for src + * (4) MLLI for dst + */ rc = ssi_buffer_mgr_aead_chain_assoc(drvdata, req, &sg_data, false, true); if (unlikely(rc != 0)) goto aead_map_failure; @@ -1793,7 +1803,8 @@ void ssi_buffer_mgr_unmap_hash_request( &areq_ctx->buff1_cnt; /*In case a pool was set, a table was - allocated and should be released */ + *allocated and should be released + */ if (areq_ctx->mlli_params.curr_pool != NULL) { SSI_LOG_DEBUG("free MLLI buffer: dma=0x%llX virt=%pK\n", (unsigned long long)areq_ctx->mlli_params.mlli_dma_addr,