summaryrefslogtreecommitdiff
path: root/drivers/crypto/caam
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2014-04-24 18:05:14 (GMT)
committerMatthew Weigel <Matthew.Weigel@freescale.com>2014-12-11 18:41:23 (GMT)
commitde9f96f35f4f86d83e80bb333f922c0584740b50 (patch)
tree5d982729361402c460135b9130480827c311dfa5 /drivers/crypto/caam
parentaf7f665cc19c78ad468b1435034f56df1558a62d (diff)
downloadlinux-fsl-qoriq-de9f96f35f4f86d83e80bb333f922c0584740b50.tar.xz
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> (cherry picked from commit 867e1ee395d845f49ae280c3d8f5271b214fa7e4)
Diffstat (limited to 'drivers/crypto/caam')
-rw-r--r--drivers/crypto/caam/error.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index 3d7be4c..961331d 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -265,10 +265,18 @@ void caam_jr_strstatus(struct device *jrdev, u32 status)
};
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);
- 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);
}