Skip to content

Commit e397ee0

Browse files
Marek Vasutherbertx
authored andcommitted
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>
1 parent e22cdcf commit e397ee0

1 file changed

Lines changed: 20 additions & 21 deletions

File tree

‎drivers/crypto/caam/error.c‎

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
static const struct {
1515
u8 value;
16-
char *error_text;
16+
const char *error_text;
1717
} desc_error_list[] = {
1818
{ 0x00, "No error." },
1919
{ 0x01, "SGT Length Error. The descriptor is trying to read "
@@ -158,8 +158,8 @@ static const char * const rng_err_id_list[] = {
158158
"Secure key generation",
159159
};
160160

161-
static void report_ccb_status(struct device *jrdev, u32 status,
162-
const char *error, char *__outstr)
161+
static void report_ccb_status(struct device *jrdev, const u32 status,
162+
const char *error)
163163
{
164164
u8 cha_id = (status & JRSTA_CCBERR_CHAID_MASK) >>
165165
JRSTA_CCBERR_CHAID_SHIFT;
@@ -198,21 +198,21 @@ static void report_ccb_status(struct device *jrdev, u32 status,
198198
err_str, err_err_code);
199199
}
200200

201-
static void report_jump_status(struct device *jrdev, u32 status,
202-
const char *error, char *outstr)
201+
static void report_jump_status(struct device *jrdev, const u32 status,
202+
const char *error)
203203
{
204204
dev_err(jrdev, "%08x: %s: %s() not implemented\n",
205205
status, error, __func__);
206206
}
207207

208-
static void report_deco_status(struct device *jrdev, u32 status,
209-
const char *error, char *__outstr)
208+
static void report_deco_status(struct device *jrdev, const u32 status,
209+
const char *error)
210210
{
211211
u8 err_id = status & JRSTA_DECOERR_ERROR_MASK;
212212
u8 idx = (status & JRSTA_DECOERR_INDEX_MASK) >>
213213
JRSTA_DECOERR_INDEX_SHIFT;
214214
char *idx_str;
215-
char *err_str = "unidentified error value 0x";
215+
const char *err_str = "unidentified error value 0x";
216216
char err_err_code[3] = { 0 };
217217
int i;
218218

@@ -234,15 +234,15 @@ static void report_deco_status(struct device *jrdev, u32 status,
234234
status, error, idx_str, idx, err_str, err_err_code);
235235
}
236236

237-
static void report_jr_status(struct device *jrdev, u32 status,
238-
const char *error, char *outstr)
237+
static void report_jr_status(struct device *jrdev, const u32 status,
238+
const char *error)
239239
{
240240
dev_err(jrdev, "%08x: %s: %s() not implemented\n",
241241
status, error, __func__);
242242
}
243243

244-
static void report_cond_code_status(struct device *jrdev, u32 status,
245-
const char *error, char *outstr)
244+
static void report_cond_code_status(struct device *jrdev, const u32 status,
245+
const char *error)
246246
{
247247
dev_err(jrdev, "%08x: %s: %s() not implemented\n",
248248
status, error, __func__);
@@ -251,8 +251,8 @@ static void report_cond_code_status(struct device *jrdev, u32 status,
251251
void caam_jr_strstatus(struct device *jrdev, u32 status)
252252
{
253253
static const struct stat_src {
254-
void (*report_ssed)(struct device *jrdev, u32 status,
255-
const char *error, char *outstr);
254+
void (*report_ssed)(struct device *jrdev, const u32 status,
255+
const char *error);
256256
const char *error;
257257
} status_src[] = {
258258
{ NULL, "No error" },
@@ -265,17 +265,16 @@ void caam_jr_strstatus(struct device *jrdev, u32 status)
265265
{ report_cond_code_status, "Condition Code" },
266266
};
267267
u32 ssrc = status >> JRSTA_SSRC_SHIFT;
268+
const char *error = status_src[ssrc].error;
268269

269270
/*
270271
* If there is no further error handling function, just
271-
* print the error code, error string and exit.
272+
* print the error code, error string and exit. Otherwise
273+
* call the handler function.
272274
*/
273-
if (!status_src[ssrc].report_ssed) {
275+
if (!status_src[ssrc].report_ssed)
274276
dev_err(jrdev, "%08x: %s: \n", status, status_src[ssrc].error);
275-
return;
276-
}
277-
278-
status_src[ssrc].report_ssed(jrdev, status,
279-
status_src[ssrc].error, NULL);
277+
else
278+
status_src[ssrc].report_ssed(jrdev, status, error);
280279
}
281280
EXPORT_SYMBOL(caam_jr_strstatus);

0 commit comments

Comments
 (0)