From patchwork Tue Dec 12 14:53:07 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: 121541 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4224768qgn; Tue, 12 Dec 2017 06:56:30 -0800 (PST) X-Google-Smtp-Source: ACJfBouUFCOCLe3mKe+qgRCRfoUAZv+BPkDAhmLxzlenK+MkOTYqkGXSHkYFS25Mf794asa/uuZ2 X-Received: by 10.98.8.67 with SMTP id c64mr2603357pfd.50.1513090590844; Tue, 12 Dec 2017 06:56:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513090590; cv=none; d=google.com; s=arc-20160816; b=a5bJTybDjTCx3GiFmkX/xnmaoGPDdRRjTnvNK7JBPH1OhtA+mMQAyxONY69SJtOskc UPJ82DynarIoUxRfiEoZkfNTqy7OOMiyeFJOKSnPtosgNZdJJHaqVN2NDn9DU2HdZUl5 Bts13dMKA1mYwH7ljKBRb+tPhjpbf6utN58A+5fkgREViRrqYVJtDa658v2ejtWdewzP zD7roH5+iZG6WIOuNTJLIbW3fnBqA0bBJbcyzVFrcSxJGJIGesq8yloU+JAMR8xFJpDX JcAtd6VAbcdkuE/mUw1oNlTLT5/w/L/cWiRiMeV+UZhIyBjVvwTMMEL+7gc0pybxaJyP LRPA== 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=KtvILDsE3aLJp8ViA/ZbvZVHQLl6zdaJQ9UHHbwyTa0=; b=0Uf1cOP4X6i40T7RKtI8XZy6kLuwsSsS793ngrFXltiCJmmPJsOaha+bW48gWH/nl1 zkO/fTVVlGB7iGdWvkxrbwbqgLWbfDj1hijGneeNXCSeVaLE+5on+5yOOYbgoe6uVQET oBv8U3Mn3BmLvsPdyoYaCYHtXiQoqGHmsPkRldTDy9kuPCFYOxxmDNct+DPCLPwInUp4 PSYF5gyAH3m1tP0sOaxwr5XIgb7IuMbaKAVuxZer9+YHx6oflIioYNXl8N4iNhOhfC83 xCwyaRvUvfluE+I+7RxIQOdPT9im+6l5ZksxOYySjrL2uQXor8IU8XCnBgVOS4Ol3qlP uHCQ== 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 u190si11570761pgb.657.2017.12.12.06.56.30; Tue, 12 Dec 2017 06:56:30 -0800 (PST) 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 S1753049AbdLLO43 (ORCPT + 1 other); Tue, 12 Dec 2017 09:56:29 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45236 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753038AbdLLO4Y (ORCPT ); Tue, 12 Dec 2017 09:56:24 -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 64C551529; Tue, 12 Dec 2017 06:56:24 -0800 (PST) Received: from sugar.kfn.arm.com (unknown [10.45.48.196]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E5BE23F318; Tue, 12 Dec 2017 06:56:21 -0800 (PST) From: Gilad Ben-Yossef To: Greg Kroah-Hartman Cc: Ofir Drang , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 21/24] staging: ccree: fix buf mgr naming convention Date: Tue, 12 Dec 2017 14:53:07 +0000 Message-Id: <1513090395-7938-22-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513090395-7938-1-git-send-email-gilad@benyossef.com> References: <1513090395-7938-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 buffer manager files were using a func naming convention which was inconsistent (ssi vs. cc) and often too long. Make the code more readable by switching to a simpler, consistent naming convention. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) -- 2.7.4 diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index 8649bcb..6846d93 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.c +++ b/drivers/staging/ccree/ssi_buffer_mgr.c @@ -413,11 +413,9 @@ static int cc_map_sg(struct device *dev, struct scatterlist *sg, } static int -ssi_aead_handle_config_buf(struct device *dev, - struct aead_req_ctx *areq_ctx, - u8 *config_data, - struct buffer_array *sg_data, - unsigned int assoclen) +cc_set_aead_conf_buf(struct device *dev, struct aead_req_ctx *areq_ctx, + u8 *config_data, struct buffer_array *sg_data, + unsigned int assoclen) { dev_dbg(dev, " handle additional data config set to DLLI\n"); /* create sg for the current buffer */ @@ -441,10 +439,9 @@ ssi_aead_handle_config_buf(struct device *dev, return 0; } -static int ssi_ahash_handle_curr_buf(struct device *dev, - struct ahash_req_ctx *areq_ctx, - u8 *curr_buff, u32 curr_buff_cnt, - struct buffer_array *sg_data) +static int cc_set_hash_buf(struct device *dev, struct ahash_req_ctx *areq_ctx, + u8 *curr_buff, u32 curr_buff_cnt, + struct buffer_array *sg_data) { dev_dbg(dev, " handle curr buff %x set to DLLI\n", curr_buff_cnt); /* create sg for the current buffer */ @@ -1259,9 +1256,8 @@ int cc_map_aead_request(struct cc_drvdata *drvdata, struct aead_request *req) } areq_ctx->ccm_iv0_dma_addr = dma_addr; - if (ssi_aead_handle_config_buf(dev, areq_ctx, - areq_ctx->ccm_config, &sg_data, - req->assoclen)) { + if (cc_set_aead_conf_buf(dev, areq_ctx, areq_ctx->ccm_config, + &sg_data, req->assoclen)) { rc = -ENOMEM; goto aead_map_failure; } @@ -1432,8 +1428,8 @@ int cc_map_hash_request_final(struct cc_drvdata *drvdata, void *ctx, /*TODO: copy data in case that buffer is enough for operation */ /* map the previous buffer */ if (*curr_buff_cnt) { - if (ssi_ahash_handle_curr_buf(dev, areq_ctx, curr_buff, - *curr_buff_cnt, &sg_data)) { + if (cc_set_hash_buf(dev, areq_ctx, curr_buff, *curr_buff_cnt, + &sg_data)) { return -ENOMEM; } } @@ -1545,8 +1541,8 @@ int cc_map_hash_request_update(struct cc_drvdata *drvdata, void *ctx, } if (*curr_buff_cnt) { - if (ssi_ahash_handle_curr_buf(dev, areq_ctx, curr_buff, - *curr_buff_cnt, &sg_data)) { + if (cc_set_hash_buf(dev, areq_ctx, curr_buff, *curr_buff_cnt, + &sg_data)) { return -ENOMEM; } /* change the buffer index for next operation */