linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: linux-crypto@vger.kernel.org
Cc: Marek Vasut <marex@denx.de>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Horia Geanta <horia.geanta@freescale.com>
Subject: [PATCH 06/11] crypto: caam: Dissolve report_jump_idx()
Date: Thu, 24 Apr 2014 20:05:17 +0200	[thread overview]
Message-ID: <1398362722-16430-7-git-send-email-marex@denx.de> (raw)
In-Reply-To: <1398362722-16430-1-git-send-email-marex@denx.de>

Just dissolve this function so it's not in the way of applying
further white magic cleanup down the line.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
---
 drivers/crypto/caam/error.c | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index a8736abd7..aa7d5cf 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -168,19 +168,6 @@ static const char * const rng_err_id_list[] = {
 	kfree(tmp);						\
 }
 
-static void report_jump_idx(u32 status, char *outstr)
-{
-	u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >>
-		  JRSTA_DECOERR_INDEX_SHIFT;
-
-	if (status & JRSTA_DECOERR_JUMP)
-		strcat(outstr, "jump tgt desc idx ");
-	else
-		strcat(outstr, "desc idx ");
-
-	SPRINTFCAT(outstr, "%d: ", idx, sizeof("255"));
-}
-
 static void report_ccb_status(struct device *jrdev, u32 status,
 			      const char *error, char *__outstr)
 {
@@ -189,10 +176,17 @@ static void report_ccb_status(struct device *jrdev, u32 status,
 	u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >>
 		    JRSTA_CCBERR_CHAID_SHIFT;
 	u8 err_id = status & JRSTA_CCBERR_ERRID_MASK;
+	u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >>
+		  JRSTA_DECOERR_INDEX_SHIFT;
 
 	sprintf(outstr, "%s: ", error);
 
-	report_jump_idx(status, outstr);
+	if (status & JRSTA_DECOERR_JUMP)
+		strcat(outstr, "jump tgt desc idx ");
+	else
+		strcat(outstr, "desc idx ");
+
+	SPRINTFCAT(outstr, "%d: ", idx, sizeof("255"));
 
 	if (cha_id < ARRAY_SIZE(cha_id_list)) {
 		SPRINTFCAT(outstr, "%s: ", cha_id_list[cha_id],
@@ -232,10 +226,18 @@ static void report_deco_status(struct device *jrdev, u32 status,
 	char outstr[CAAM_ERROR_STR_MAX];
 
 	u8 desc_error = status & JRSTA_DECOERR_ERROR_MASK;
+	u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >>
+		  JRSTA_DECOERR_INDEX_SHIFT;
+
 	int i;
 	sprintf(outstr, "%s: ", error);
 
-	report_jump_idx(status, outstr);
+	if (status & JRSTA_DECOERR_JUMP)
+		strcat(outstr, "jump tgt desc idx ");
+	else
+		strcat(outstr, "desc idx ");
+
+	SPRINTFCAT(outstr, "%d: ", idx, sizeof("255"));
 
 	for (i = 0; i < ARRAY_SIZE(desc_error_list); i++)
 		if (desc_error_list[i].value == desc_error)
-- 
1.9.2

  parent reply	other threads:[~2014-04-24 18:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24 18:05 [PATCH 00/11] crypto: caam: Error reporting fixes Marek Vasut
2014-04-24 18:05 ` [PATCH 01/11] crypto: caam: Contain caam_jr_strstatus() ugliness Marek Vasut
2014-04-24 18:05 ` [PATCH 02/11] crypto: caam: Pull all the error codes out Marek Vasut
2014-04-24 18:05 ` [PATCH 03/11] crypto: caam: Implement fast-path for error codes with no handler Marek Vasut
2014-04-24 18:05 ` [PATCH 04/11] crypto: caam: Pass error type into the functions Marek Vasut
2014-04-24 18:05 ` [PATCH 05/11] crypto: caam: Kill the easy targets Marek Vasut
2014-04-24 18:05 ` Marek Vasut [this message]
2014-04-24 18:05 ` [PATCH 07/11] crypto: caam: Clean up report_ccb_status() Marek Vasut
2014-04-24 18:05 ` [PATCH 08/11] crypto: caam: Clean up report_deco_status() Marek Vasut
2014-04-24 18:05 ` [PATCH 09/11] crypto: caam: Kill SPRINTFCAT() with fire Marek Vasut
2014-04-24 18:05 ` [PATCH 10/11] crypto: caam: Sweep the remnants Marek Vasut
2014-04-24 18:05 ` [PATCH 11/11] crypto: caam: Fix the 'quoted string split across lines' Marek Vasut
2014-04-25 18:20 ` [PATCH 00/11] crypto: caam: Error reporting fixes Kees Cook
2014-05-08 14:01 ` Herbert Xu
2014-05-08 14:50   ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398362722-16430-7-git-send-email-marex@denx.de \
    --to=marex@denx.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=horia.geanta@freescale.com \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).