diff options
author | Marek Vasut <marex@denx.de> | 2014-04-24 14:05:17 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-05-08 09:58:09 -0400 |
commit | 526243cc872398ed8139a52ee0bf7715a3abcf31 (patch) | |
tree | 93467043b7b3848587e11813a8bb26d2b8ef4c7d | |
parent | e75880dd9afb60ff59efe079ac50ccc16daffe54 (diff) |
crypto: caam - Dissolve report_jump_idx()
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/caam/error.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c index a8736abd717d..aa7d5cf2a294 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[] = { | |||
168 | kfree(tmp); \ | 168 | kfree(tmp); \ |
169 | } | 169 | } |
170 | 170 | ||
171 | static void report_jump_idx(u32 status, char *outstr) | ||
172 | { | ||
173 | u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >> | ||
174 | JRSTA_DECOERR_INDEX_SHIFT; | ||
175 | |||
176 | if (status & JRSTA_DECOERR_JUMP) | ||
177 | strcat(outstr, "jump tgt desc idx "); | ||
178 | else | ||
179 | strcat(outstr, "desc idx "); | ||
180 | |||
181 | SPRINTFCAT(outstr, "%d: ", idx, sizeof("255")); | ||
182 | } | ||
183 | |||
184 | static void report_ccb_status(struct device *jrdev, u32 status, | 171 | static void report_ccb_status(struct device *jrdev, u32 status, |
185 | const char *error, char *__outstr) | 172 | const char *error, char *__outstr) |
186 | { | 173 | { |
@@ -189,10 +176,17 @@ static void report_ccb_status(struct device *jrdev, u32 status, | |||
189 | u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >> | 176 | u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >> |
190 | JRSTA_CCBERR_CHAID_SHIFT; | 177 | JRSTA_CCBERR_CHAID_SHIFT; |
191 | u8 err_id = status & JRSTA_CCBERR_ERRID_MASK; | 178 | u8 err_id = status & JRSTA_CCBERR_ERRID_MASK; |
179 | u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >> | ||
180 | JRSTA_DECOERR_INDEX_SHIFT; | ||
192 | 181 | ||
193 | sprintf(outstr, "%s: ", error); | 182 | sprintf(outstr, "%s: ", error); |
194 | 183 | ||
195 | report_jump_idx(status, outstr); | 184 | if (status & JRSTA_DECOERR_JUMP) |
185 | strcat(outstr, "jump tgt desc idx "); | ||
186 | else | ||
187 | strcat(outstr, "desc idx "); | ||
188 | |||
189 | SPRINTFCAT(outstr, "%d: ", idx, sizeof("255")); | ||
196 | 190 | ||
197 | if (cha_id < ARRAY_SIZE(cha_id_list)) { | 191 | if (cha_id < ARRAY_SIZE(cha_id_list)) { |
198 | SPRINTFCAT(outstr, "%s: ", cha_id_list[cha_id], | 192 | SPRINTFCAT(outstr, "%s: ", cha_id_list[cha_id], |
@@ -232,10 +226,18 @@ static void report_deco_status(struct device *jrdev, u32 status, | |||
232 | char outstr[CAAM_ERROR_STR_MAX]; | 226 | char outstr[CAAM_ERROR_STR_MAX]; |
233 | 227 | ||
234 | u8 desc_error = status & JRSTA_DECOERR_ERROR_MASK; | 228 | u8 desc_error = status & JRSTA_DECOERR_ERROR_MASK; |
229 | u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >> | ||
230 | JRSTA_DECOERR_INDEX_SHIFT; | ||
231 | |||
235 | int i; | 232 | int i; |
236 | sprintf(outstr, "%s: ", error); | 233 | sprintf(outstr, "%s: ", error); |
237 | 234 | ||
238 | report_jump_idx(status, outstr); | 235 | if (status & JRSTA_DECOERR_JUMP) |
236 | strcat(outstr, "jump tgt desc idx "); | ||
237 | else | ||
238 | strcat(outstr, "desc idx "); | ||
239 | |||
240 | SPRINTFCAT(outstr, "%d: ", idx, sizeof("255")); | ||
239 | 241 | ||
240 | for (i = 0; i < ARRAY_SIZE(desc_error_list); i++) | 242 | for (i = 0; i < ARRAY_SIZE(desc_error_list); i++) |
241 | if (desc_error_list[i].value == desc_error) | 243 | if (desc_error_list[i].value == desc_error) |