diff options
Diffstat (limited to 'drivers/staging/ccree/ssi_fips_ext.c')
-rw-r--r-- | drivers/staging/ccree/ssi_fips_ext.c | 76 |
1 files changed, 36 insertions, 40 deletions
diff --git a/drivers/staging/ccree/ssi_fips_ext.c b/drivers/staging/ccree/ssi_fips_ext.c index 2ac432fe1233..e7bf1843f60c 100644 --- a/drivers/staging/ccree/ssi_fips_ext.c +++ b/drivers/staging/ccree/ssi_fips_ext.c @@ -1,49 +1,47 @@ /* * Copyright (C) 2012-2017 ARM Limited or its affiliates. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, see <http://www.gnu.org/licenses/>. */ /************************************************************** -This file defines the driver FIPS functions that should be -implemented by the driver user. Current implementation is sample code only. -***************************************************************/ + * This file defines the driver FIPS functions that should be + * implemented by the driver user. Current implementation is sample code only. + ***************************************************************/ #include <linux/module.h> #include "ssi_fips_local.h" #include "ssi_driver.h" - 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 ssi_fips_error_t fips_error = CC_REE_FIPS_ERROR_OK; +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; /* -This function returns the FIPS REE state. -The function should be implemented by the driver user, depends on where . -the state value is stored. -The reference code uses global variable. -*/ -int ssi_fips_ext_get_state(ssi_fips_state_t *p_state) + * This function returns the FIPS REE state. + * The function should be implemented by the driver user, depends on where + * the state value is stored. + * The reference code uses global variable. + */ +int ssi_fips_ext_get_state(enum cc_fips_state_t *p_state) { - int rc = 0; + int rc = 0; - if (p_state == NULL) { + if (!p_state) return -EINVAL; - } *p_state = fips_state; @@ -51,18 +49,17 @@ int ssi_fips_ext_get_state(ssi_fips_state_t *p_state) } /* -This function returns the FIPS REE error. -The function should be implemented by the driver user, depends on where . -the error value is stored. -The reference code uses global variable. -*/ -int ssi_fips_ext_get_error(ssi_fips_error_t *p_err) + * This function returns the FIPS REE error. + * The function should be implemented by the driver user, depends on where + * the error value is stored. + * The reference code uses global variable. + */ +int ssi_fips_ext_get_error(enum cc_fips_error *p_err) { - int rc = 0; + int rc = 0; - if (p_err == NULL) { + if (!p_err) return -EINVAL; - } *p_err = fips_error; @@ -70,27 +67,26 @@ int ssi_fips_ext_get_error(ssi_fips_error_t *p_err) } /* -This function sets the FIPS REE state. -The function should be implemented by the driver user, depends on where . -the state value is stored. -The reference code uses global variable. -*/ -int ssi_fips_ext_set_state(ssi_fips_state_t state) + * This function sets the FIPS REE state. + * The function should be implemented by the driver user, depends on where + * the state value is stored. + * The reference code uses global variable. + */ +int ssi_fips_ext_set_state(enum cc_fips_state_t state) { fips_state = state; return 0; } /* -This function sets the FIPS REE error. -The function should be implemented by the driver user, depends on where . -the error value is stored. -The reference code uses global variable. -*/ -int ssi_fips_ext_set_error(ssi_fips_error_t err) + * This function sets the FIPS REE error. + * The function should be implemented by the driver user, depends on where + * the error value is stored. + * The reference code uses global variable. + */ +int ssi_fips_ext_set_error(enum cc_fips_error err) { fips_error = err; return 0; } - |