mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
crypto: caam - Implement fast-path for error codes with no handler
Implement fast-path error code printout for errors with no associated handler function. This reduces calls to this kmalloc() nonsense in SPRINTFCAT() already. Note that the format of output is compatible with the old code, even if -- exposed like this -- it looks a bit weird. Checkpatch complains on this one as well. 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>
This commit is contained in:
parent
9724d7adbb
commit
867e1ee395
1 changed files with 10 additions and 2 deletions
|
@ -265,10 +265,18 @@ void caam_jr_strstatus(struct device *jrdev, u32 status)
|
||||||
};
|
};
|
||||||
u32 ssrc = status >> JRSTA_SSRC_SHIFT;
|
u32 ssrc = status >> JRSTA_SSRC_SHIFT;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If there is no further error handling function, just
|
||||||
|
* print the error code, error string and exit.
|
||||||
|
*/
|
||||||
|
if (!status_src[ssrc].report_ssed) {
|
||||||
|
dev_err(jrdev, "%08x: %s: \n", status, status_src[ssrc].error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sprintf(outstr, "%s: ", status_src[ssrc].error);
|
sprintf(outstr, "%s: ", status_src[ssrc].error);
|
||||||
|
|
||||||
if (status_src[ssrc].report_ssed)
|
status_src[ssrc].report_ssed(status, outstr);
|
||||||
status_src[ssrc].report_ssed(status, outstr);
|
|
||||||
|
|
||||||
dev_err(jrdev, "%08x: %s\n", status, outstr);
|
dev_err(jrdev, "%08x: %s\n", status, outstr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue