From patchwork Sun Dec 3 13:58:21 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: 120464 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3361738qgn; Sun, 3 Dec 2017 06:00:25 -0800 (PST) X-Google-Smtp-Source: AGs4zMa71eaLeh7W9J8KxsqZB39115aj4VFFamGbAvj9nK0GZjSXXbqCB7r7+K3PocDR8NypGfwH X-Received: by 10.101.80.197 with SMTP id s5mr11056745pgp.399.1512309625373; Sun, 03 Dec 2017 06:00:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512309625; cv=none; d=google.com; s=arc-20160816; b=r2Qo2H4j6tTLQSxklLZ9OUqkHdsB6vdcLNxgMKMcRyaPa+239la5uQflcUTCsG22lS 6KM3g70WNIuYYaI2CB5RDlpFVY3bIO0dDbZXxwPJMQwm/p1yV96Wfy93JPRbRiByjWrz ebtLdyo5Ce4oJkfZH3SsyT66Rk1qevNLsfXE97rS35bZNgifnTqUAl6/svvCQbyys5lV lVKTe0ZPp41fYyE3U8kS6FwccmFIfCB789tPlMGVzlBhB9dOTyelWs5ZXKOpeMOnSxaO TVW119MCrZOuwejOtHrRuSlbNLOu4OuydZoBhMscODD3s+WLaLKA+I14l2Jippo6fbku 4UDg== 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=3HD0Ku6kivEyVxt2/I1kCkkFhsELqRcBn0JLMONiAdA=; b=TjTAAiipmV/54iyhm7Td4DHDKWaJSnauACRfTOykvownB8QlZp/cfj/JpIUXVUwy4S 35fyJ4Za5fo8MJPGLjvfxkSCwlkOJfy13GdV176cVboS/ZTi/YT5U3ngWojSeFIpxg4B mwK4FZoGpzA+nBdam3N5V7M5vjVqjsWMG1KJ1tKbrhECrIMaHkVaHbDoKkDdSkz7u3VA QYzy8/aFVXOL4YIwPHKtgxBxjRczDZnWVLVXjFJ1pNI+XrfyFWVWmO9lQrZk1PPh34hF WpYYYc1xQ92kO+aG7ix1eOW64csU24NWUsauht/BxSZOdL7tfNyurLSk3POJiRM9NZlj CXKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 134si7793721pgg.733.2017.12.03.06.00.25; Sun, 03 Dec 2017 06:00:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752646AbdLCOAW (ORCPT + 28 others); Sun, 3 Dec 2017 09:00:22 -0500 Received: from foss.arm.com ([217.140.101.70]:55236 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752607AbdLCOAH (ORCPT ); Sun, 3 Dec 2017 09:00:07 -0500 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 2B76A1529; Sun, 3 Dec 2017 06:00:07 -0800 (PST) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 407213F24A; Sun, 3 Dec 2017 06:00:05 -0800 (PST) From: Gilad Ben-Yossef To: Greg Kroah-Hartman Cc: Ofir Drang , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org Subject: [PATCH 10/10] staging: ccree: amend aead func def for readability Date: Sun, 3 Dec 2017 13:58:21 +0000 Message-Id: <1512309503-29766-11-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512309503-29766-1-git-send-email-gilad@benyossef.com> References: <1512309503-29766-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Func definitions in the aead implementation were did not adhere to coding style. Fix them for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 141 ++++++++++++++------------------------- 1 file changed, 51 insertions(+), 90 deletions(-) -- 2.7.4 diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index 54edd99..5548c7b 100644 --- a/drivers/staging/ccree/ssi_aead.c +++ b/drivers/staging/ccree/ssi_aead.c @@ -678,9 +678,8 @@ static int cc_rfc4309_ccm_setkey(struct crypto_aead *tfm, const u8 *key, } #endif /*SSI_CC_HAS_AES_CCM*/ -static int cc_aead_setauthsize( - struct crypto_aead *authenc, - unsigned int authsize) +static int cc_aead_setauthsize(struct crypto_aead *authenc, + unsigned int authsize) { struct cc_aead_ctx *ctx = crypto_aead_ctx(authenc); struct device *dev = drvdata_to_dev(ctx->drvdata); @@ -733,12 +732,8 @@ static int cc_ccm_setauthsize(struct crypto_aead *authenc, } #endif /*SSI_CC_HAS_AES_CCM*/ -static void -cc_set_assoc_desc( - struct aead_request *areq, - unsigned int flow_mode, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_set_assoc_desc(struct aead_request *areq, unsigned int flow_mode, + struct cc_hw_desc desc[], unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(areq); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -776,13 +771,10 @@ cc_set_assoc_desc( *seq_size = (++idx); } -static void -cc_proc_authen_desc( - struct aead_request *areq, - unsigned int flow_mode, - struct cc_hw_desc desc[], - unsigned int *seq_size, - int direct) +static void cc_proc_authen_desc(struct aead_request *areq, + unsigned int flow_mode, + struct cc_hw_desc desc[], + unsigned int *seq_size, int direct) { struct aead_req_ctx *areq_ctx = aead_request_ctx(areq); enum ssi_req_dma_buf_type data_dma_type = areq_ctx->data_buff_type; @@ -843,12 +835,10 @@ cc_proc_authen_desc( *seq_size = (++idx); } -static void -cc_proc_cipher_desc( - struct aead_request *areq, - unsigned int flow_mode, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_proc_cipher_desc(struct aead_request *areq, + unsigned int flow_mode, + struct cc_hw_desc desc[], + unsigned int *seq_size) { unsigned int idx = *seq_size; struct aead_req_ctx *areq_ctx = aead_request_ctx(areq); @@ -891,10 +881,9 @@ cc_proc_cipher_desc( *seq_size = (++idx); } -static void cc_proc_digest_desc( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_proc_digest_desc(struct aead_request *req, + struct cc_hw_desc desc[], + unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -942,10 +931,9 @@ static void cc_proc_digest_desc( *seq_size = (++idx); } -static void cc_set_cipher_desc( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_set_cipher_desc(struct aead_request *req, + struct cc_hw_desc desc[], + unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -988,11 +976,8 @@ static void cc_set_cipher_desc( *seq_size = idx; } -static void cc_proc_cipher( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size, - unsigned int data_flow_mode) +static void cc_proc_cipher(struct aead_request *req, struct cc_hw_desc desc[], + unsigned int *seq_size, unsigned int data_flow_mode) { struct aead_req_ctx *req_ctx = aead_request_ctx(req); int direct = req_ctx->gen_ctx.op_type; @@ -1014,10 +999,8 @@ static void cc_proc_cipher( *seq_size = idx; } -static void cc_set_hmac_desc( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_set_hmac_desc(struct aead_request *req, struct cc_hw_desc desc[], + unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -1051,10 +1034,8 @@ static void cc_set_hmac_desc( *seq_size = idx; } -static void cc_set_xcbc_desc( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_set_xcbc_desc(struct aead_request *req, struct cc_hw_desc desc[], + unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -1113,10 +1094,9 @@ static void cc_set_xcbc_desc( *seq_size = idx; } -static void cc_proc_header_desc( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_proc_header_desc(struct aead_request *req, + struct cc_hw_desc desc[], + unsigned int *seq_size) { unsigned int idx = *seq_size; /* Hash associated data */ @@ -1127,10 +1107,9 @@ static void cc_proc_header_desc( *seq_size = idx; } -static void cc_proc_scheme_desc( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_proc_scheme_desc(struct aead_request *req, + struct cc_hw_desc desc[], + unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -1192,10 +1171,8 @@ static void cc_proc_scheme_desc( *seq_size = idx; } -static void cc_mlli_to_sram( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_mlli_to_sram(struct aead_request *req, + struct cc_hw_desc desc[], unsigned int *seq_size) { struct aead_req_ctx *req_ctx = aead_request_ctx(req); struct crypto_aead *tfm = crypto_aead_reqtfm(req); @@ -1221,10 +1198,9 @@ static void cc_mlli_to_sram( } } -static enum cc_flow_mode cc_get_data_flow( - enum drv_crypto_direction direct, - enum cc_flow_mode setup_flow_mode, - bool is_single_pass) +static enum cc_flow_mode cc_get_data_flow(enum drv_crypto_direction direct, + enum cc_flow_mode setup_flow_mode, + bool is_single_pass) { enum cc_flow_mode data_flow_mode; @@ -1247,10 +1223,8 @@ static enum cc_flow_mode cc_get_data_flow( return data_flow_mode; } -static void cc_hmac_authenc( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_hmac_authenc(struct aead_request *req, struct cc_hw_desc desc[], + unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -1301,10 +1275,8 @@ static void cc_hmac_authenc( } static void -cc_xcbc_authenc( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +cc_xcbc_authenc(struct aead_request *req, struct cc_hw_desc desc[], + unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -1449,10 +1421,8 @@ static int set_msg_len(u8 *block, unsigned int msglen, unsigned int csize) return 0; } -static int cc_ccm( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static int cc_ccm(struct aead_request *req, struct cc_hw_desc desc[], + unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -1659,10 +1629,8 @@ static void cc_proc_rfc4309_ccm(struct aead_request *req) #if SSI_CC_HAS_AES_GCM -static void cc_set_ghash_desc( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_set_ghash_desc(struct aead_request *req, + struct cc_hw_desc desc[], unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -1739,10 +1707,8 @@ static void cc_set_ghash_desc( *seq_size = idx; } -static void cc_set_gctr_desc( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_set_gctr_desc(struct aead_request *req, struct cc_hw_desc desc[], + unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -1777,10 +1743,9 @@ static void cc_set_gctr_desc( *seq_size = idx; } -static void cc_proc_gcm_result( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static void cc_proc_gcm_result(struct aead_request *req, + struct cc_hw_desc desc[], + unsigned int *seq_size) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm); @@ -1843,10 +1808,8 @@ static void cc_proc_gcm_result( *seq_size = idx; } -static int cc_gcm( - struct aead_request *req, - struct cc_hw_desc desc[], - unsigned int *seq_size) +static int cc_gcm(struct aead_request *req, struct cc_hw_desc desc[], + unsigned int *seq_size) { struct aead_req_ctx *req_ctx = aead_request_ctx(req); unsigned int cipher_flow_mode; @@ -1883,9 +1846,7 @@ static int cc_gcm( } #ifdef CC_DEBUG -static void cc_dump_gcm( - const char *title, - struct aead_request *req) +static void cc_dump_gcm(const char *title, struct aead_request *req) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm);