From e397ee0f2242a5f316906e1ff05f8669791b4e2c Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 24 Apr 2014 20:05:21 +0200 Subject: crypto: caam - Sweep the remnants Clean up the remnants from the rework. Constify function arguments. Note that checkpatch again complains about this space before newline, but this is the original code behavior, so I'm keeping it. Signed-off-by: Marek Vasut Cc: Herbert Xu Cc: Horia Geanta Signed-off-by: Herbert Xu --- drivers/crypto/caam/error.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'drivers/crypto/caam/error.c') diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c index 7ed2e4f..0f4725c 100644 --- a/drivers/crypto/caam/error.c +++ b/drivers/crypto/caam/error.c @@ -13,7 +13,7 @@ static const struct { u8 value; - char *error_text; + const char *error_text; } desc_error_list[] = { { 0x00, "No error." }, { 0x01, "SGT Length Error. The descriptor is trying to read " @@ -158,8 +158,8 @@ static const char * const rng_err_id_list[] = { "Secure key generation", }; -static void report_ccb_status(struct device *jrdev, u32 status, - const char *error, char *__outstr) +static void report_ccb_status(struct device *jrdev, const u32 status, + const char *error) { u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >> JRSTA_CCBERR_CHAID_SHIFT; @@ -198,21 +198,21 @@ static void report_ccb_status(struct device *jrdev, u32 status, err_str, err_err_code); } -static void report_jump_status(struct device *jrdev, u32 status, - const char *error, char *outstr) +static void report_jump_status(struct device *jrdev, const u32 status, + const char *error) { dev_err(jrdev, "%08x: %s: %s() not implemented\n", status, error, __func__); } -static void report_deco_status(struct device *jrdev, u32 status, - const char *error, char *__outstr) +static void report_deco_status(struct device *jrdev, const u32 status, + const char *error) { u8 err_id = status & JRSTA_DECOERR_ERROR_MASK; u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >> JRSTA_DECOERR_INDEX_SHIFT; char *idx_str; - char *err_str = "unidentified error value 0x"; + const char *err_str = "unidentified error value 0x"; char err_err_code[3] = { 0 }; int i; @@ -234,15 +234,15 @@ static void report_deco_status(struct device *jrdev, u32 status, status, error, idx_str, idx, err_str, err_err_code); } -static void report_jr_status(struct device *jrdev, u32 status, - const char *error, char *outstr) +static void report_jr_status(struct device *jrdev, const u32 status, + const char *error) { dev_err(jrdev, "%08x: %s: %s() not implemented\n", status, error, __func__); } -static void report_cond_code_status(struct device *jrdev, u32 status, - const char *error, char *outstr) +static void report_cond_code_status(struct device *jrdev, const u32 status, + const char *error) { dev_err(jrdev, "%08x: %s: %s() not implemented\n", status, error, __func__); @@ -251,8 +251,8 @@ static void report_cond_code_status(struct device *jrdev, u32 status, void caam_jr_strstatus(struct device *jrdev, u32 status) { static const struct stat_src { - void (*report_ssed)(struct device *jrdev, u32 status, - const char *error, char *outstr); + void (*report_ssed)(struct device *jrdev, const u32 status, + const char *error); const char *error; } status_src[] = { { NULL, "No error" }, @@ -265,17 +265,16 @@ void caam_jr_strstatus(struct device *jrdev, u32 status) { report_cond_code_status, "Condition Code" }, }; u32 ssrc = status >> JRSTA_SSRC_SHIFT; + const char *error = status_src[ssrc].error; /* * If there is no further error handling function, just - * print the error code, error string and exit. + * print the error code, error string and exit. Otherwise + * call the handler function. */ - if (!status_src[ssrc].report_ssed) { + if (!status_src[ssrc].report_ssed) dev_err(jrdev, "%08x: %s: \n", status, status_src[ssrc].error); - return; - } - - status_src[ssrc].report_ssed(jrdev, status, - status_src[ssrc].error, NULL); + else + status_src[ssrc].report_ssed(jrdev, status, error); } EXPORT_SYMBOL(caam_jr_strstatus); -- cgit v1.1