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); }