From patchwork Tue Dec 12 14:53:08 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: 121544 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4225895qgn; Tue, 12 Dec 2017 06:57:31 -0800 (PST) X-Google-Smtp-Source: ACJfBovL4TI+1o/7YJOmYq6MUaYjQSXmTuLfbG/+A+2akj69wMy3PNmHfollG+hbZh08AjCA7sdo X-Received: by 10.101.101.131 with SMTP id u3mr2281290pgv.76.1513090651512; Tue, 12 Dec 2017 06:57:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513090651; cv=none; d=google.com; s=arc-20160816; b=edFIFmbweEcPzKY7eElBzxpIJCgUTSk18zQrjDJ52ctdYl6hrBW0R7RTVpZSgg57Z0 /kxxEIsH3DT3pzzqWkItuWrYQyYePZfLCLtDa7wc3SbKE/BQJD8jZsc+Rx8but6H0HDk Cv22w6oH/2LWX5MFB/UJuEkO9tw4CyFp6X2L+F3cu2Wj2QTH8OP/Dlxlay1Up3zgD4ku GVsNT0NMr10vv9KMgt5C1x6foS2xPxVjftbCRFHzcfcOElM4LZo2WwXVzd1mAI2wKAEp BGl0PGPB6v1IJgZ2ZN2dBimbd3MxwkNi+z6ceJQw6JppfuJ4NKSFRHig6S3SZiSrRqDS P1Vg== 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=fES40cvTeUnox1470To/Q41Pf+UuW0dZXvuxlqFClPI=; b=hW71feSADEToLbLwlGk9quMW2uu18SgcYMGm7HrnbpKRkgaxxchSOtw+hp/APzIVKn t2L6dBmhJtCqAYwIXBHWmaPXknXuWnYdWnNvhSe0Ig8PfG+KUCZhkU/aDbXqm7dG4nHk zrmm+FKcBJvm+w7sn3+Bcn5pIst/iHK6vNRGcBm0xBL+vwkJh8M2Xyqje37rCXITAtTt HgzECqyy2IdUvIl7Nqkl6+klaJQkGE9n/dwnflyQqRV4lyBGMnUO+FcMLq5OKUWnu58U lm+HKvnKiEEOTngDpzu13PjOG1vFQmQngCYK4xb05qUOwHAK3Fzy2hwsHqNEHkbsW6HS +6ow== 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 d23si12955139pfe.339.2017.12.12.06.57.31; Tue, 12 Dec 2017 06:57:31 -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 S1752486AbdLLO53 (ORCPT + 1 other); Tue, 12 Dec 2017 09:57:29 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45246 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752745AbdLLO4d (ORCPT ); Tue, 12 Dec 2017 09:56:33 -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 19E101529; Tue, 12 Dec 2017 06:56:33 -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 2C1F93F318; Tue, 12 Dec 2017 06:56:30 -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 22/24] staging: ccree: fix sram mgr naming convention Date: Tue, 12 Dec 2017 14:53:08 +0000 Message-Id: <1513090395-7938-23-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 SRAM manager files were using a 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_driver.c | 8 ++++---- drivers/staging/ccree/ssi_sram_mgr.c | 18 +++++++++--------- drivers/staging/ccree/ssi_sram_mgr.h | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging/ccree/ssi_driver.c index 3f02ceb..6e7a396 100644 --- a/drivers/staging/ccree/ssi_driver.c +++ b/drivers/staging/ccree/ssi_driver.c @@ -312,9 +312,9 @@ static int init_cc_resources(struct platform_device *plat_dev) dev_err(dev, "CC_FIPS_INIT failed 0x%x\n", rc); goto post_sysfs_err; } - rc = ssi_sram_mgr_init(new_drvdata); + rc = cc_sram_mgr_init(new_drvdata); if (rc) { - dev_err(dev, "ssi_sram_mgr_init failed\n"); + dev_err(dev, "cc_sram_mgr_init failed\n"); goto post_fips_init_err; } @@ -391,7 +391,7 @@ static int init_cc_resources(struct platform_device *plat_dev) post_req_mgr_err: cc_req_mgr_fini(new_drvdata); post_sram_mgr_err: - ssi_sram_mgr_fini(new_drvdata); + cc_sram_mgr_fini(new_drvdata); post_fips_init_err: ssi_fips_fini(new_drvdata); post_sysfs_err: @@ -423,7 +423,7 @@ static void cleanup_cc_resources(struct platform_device *plat_dev) cc_pm_fini(drvdata); cc_buffer_mgr_fini(drvdata); cc_req_mgr_fini(drvdata); - ssi_sram_mgr_fini(drvdata); + cc_sram_mgr_fini(drvdata); ssi_fips_fini(drvdata); #ifdef ENABLE_CC_SYSFS ssi_sysfs_fini(); diff --git a/drivers/staging/ccree/ssi_sram_mgr.c b/drivers/staging/ccree/ssi_sram_mgr.c index 5d83af5..b664e9b 100644 --- a/drivers/staging/ccree/ssi_sram_mgr.c +++ b/drivers/staging/ccree/ssi_sram_mgr.c @@ -18,37 +18,37 @@ #include "ssi_sram_mgr.h" /** - * struct ssi_sram_mgr_ctx -Internal RAM context manager + * struct cc_sram_ctx -Internal RAM context manager * @sram_free_offset: the offset to the non-allocated area */ -struct ssi_sram_mgr_ctx { +struct cc_sram_ctx { cc_sram_addr_t sram_free_offset; }; /** - * ssi_sram_mgr_fini() - Cleanup SRAM pool. + * cc_sram_mgr_fini() - Cleanup SRAM pool. * * @drvdata: Associated device driver context */ -void ssi_sram_mgr_fini(struct cc_drvdata *drvdata) +void cc_sram_mgr_fini(struct cc_drvdata *drvdata) { - struct ssi_sram_mgr_ctx *smgr_ctx = drvdata->sram_mgr_handle; + struct cc_sram_ctx *smgr_ctx = drvdata->sram_mgr_handle; /* Free "this" context */ if (smgr_ctx) { - memset(smgr_ctx, 0, sizeof(struct ssi_sram_mgr_ctx)); + memset(smgr_ctx, 0, sizeof(struct cc_sram_ctx)); kfree(smgr_ctx); } } /** - * ssi_sram_mgr_init() - Initializes SRAM pool. + * cc_sram_mgr_init() - Initializes SRAM pool. * The pool starts right at the beginning of SRAM. * Returns zero for success, negative value otherwise. * * @drvdata: Associated device driver context */ -int ssi_sram_mgr_init(struct cc_drvdata *drvdata) +int cc_sram_mgr_init(struct cc_drvdata *drvdata) { /* Allocate "this" context */ drvdata->sram_mgr_handle = kzalloc(sizeof(*drvdata->sram_mgr_handle), @@ -71,7 +71,7 @@ int ssi_sram_mgr_init(struct cc_drvdata *drvdata) */ cc_sram_addr_t cc_sram_alloc(struct cc_drvdata *drvdata, u32 size) { - struct ssi_sram_mgr_ctx *smgr_ctx = drvdata->sram_mgr_handle; + struct cc_sram_ctx *smgr_ctx = drvdata->sram_mgr_handle; struct device *dev = drvdata_to_dev(drvdata); cc_sram_addr_t p; diff --git a/drivers/staging/ccree/ssi_sram_mgr.h b/drivers/staging/ccree/ssi_sram_mgr.h index 52f5288..181968a 100644 --- a/drivers/staging/ccree/ssi_sram_mgr.h +++ b/drivers/staging/ccree/ssi_sram_mgr.h @@ -40,14 +40,14 @@ typedef u64 cc_sram_addr_t; * * \return int Zero for success, negative value otherwise. */ -int ssi_sram_mgr_init(struct cc_drvdata *drvdata); +int cc_sram_mgr_init(struct cc_drvdata *drvdata); /*! * Uninits SRAM pool. * * \param drvdata */ -void ssi_sram_mgr_fini(struct cc_drvdata *drvdata); +void cc_sram_mgr_fini(struct cc_drvdata *drvdata); /*! * Allocated buffer from SRAM pool.