diff options
author | Marek Vasut <marex@denx.de> | 2014-04-24 20:05:21 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-05-08 15:58:11 +0200 |
commit | e397ee0f2242a5f316906e1ff05f8669791b4e2c (patch) | |
tree | 688c9842aec77e8c10ea0b50112fe226745bf39d /drivers/crypto | |
parent | crypto: caam - Kill SPRINTFCAT() with fire (diff) | |
download | linux-e397ee0f2242a5f316906e1ff05f8669791b4e2c.tar.xz linux-e397ee0f2242a5f316906e1ff05f8669791b4e2c.zip |
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 <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/caam/error.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c index 7ed2e4fb3c15..0f4725cc8039 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); |