Commit dff5e61e authored by Gilad Ben-Yossef's avatar Gilad Ben-Yossef Committed by Greg Kroah-Hartman

staging: ccree: remove custom type ssi_fips_state_t

Replace custom type ssi_fips_state_t with underlying enum.
Signed-off-by: default avatarGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8422f112
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
#include "ssi_fips.h" #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); extern int ssi_fips_ext_get_error(enum cc_fips_error *p_err);
/* /*
* This function returns the REE FIPS state. * This function returns the REE FIPS state.
* It should be called by kernel module. * 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; int rc = 0;
......
...@@ -22,12 +22,12 @@ ...@@ -22,12 +22,12 @@
* @brief This file contains FIPS related defintions and APIs. * @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_NOT_SUPPORTED = 0,
CC_FIPS_STATE_SUPPORTED, CC_FIPS_STATE_SUPPORTED,
CC_FIPS_STATE_ERROR, CC_FIPS_STATE_ERROR,
CC_FIPS_STATE_RESERVE32B = S32_MAX CC_FIPS_STATE_RESERVE32B = S32_MAX
} ssi_fips_state_t; };
enum cc_fips_error { enum cc_fips_error {
...@@ -57,7 +57,7 @@ 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); int ssi_fips_get_error(enum cc_fips_error *p_err);
#endif /*__SSI_FIPS_H__*/ #endif /*__SSI_FIPS_H__*/
......
...@@ -28,7 +28,7 @@ static bool tee_error; ...@@ -28,7 +28,7 @@ static bool tee_error;
module_param(tee_error, bool, 0644); module_param(tee_error, bool, 0644);
MODULE_PARM_DESC(tee_error, "Simulate TEE library failure flag: 0 - no error (default), 1 - TEE error occured "); 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; 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; ...@@ -37,7 +37,7 @@ static enum cc_fips_error fips_error = CC_REE_FIPS_ERROR_OK;
* the state value is stored. * the state value is stored.
* The reference code uses global variable. * 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; int rc = 0;
...@@ -73,7 +73,7 @@ int ssi_fips_ext_get_error(enum cc_fips_error *p_err) ...@@ -73,7 +73,7 @@ int ssi_fips_ext_get_error(enum cc_fips_error *p_err)
* the state value is stored. * the state value is stored.
* The reference code uses global variable. * 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; fips_state = state;
return 0; return 0;
......
...@@ -50,9 +50,9 @@ struct ssi_fips_handle { ...@@ -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_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); extern int ssi_fips_ext_set_error(enum cc_fips_error err);
/* FIPS power-up tests */ /* FIPS power-up tests */
...@@ -234,7 +234,7 @@ enum cc_fips_error cc_fips_run_power_up_tests(struct ssi_drvdata *drvdata) ...@@ -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) 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) { if (ssi_fips_get_state(&fips_state) != 0) {
FIPS_LOG("ssi_fips_get_state FAILED, returning.. \n"); FIPS_LOG("ssi_fips_get_state FAILED, returning.. \n");
...@@ -251,7 +251,7 @@ int ssi_fips_check_fips_error(void) ...@@ -251,7 +251,7 @@ int ssi_fips_check_fips_error(void)
/* The function sets the REE FIPS state.* /* The function sets the REE FIPS state.*
* It should be used while driver is being loaded. * 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); return ssi_fips_ext_set_state(state);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment