Skip to content

Commit

Permalink
crypto: caam - static constify error data
Browse files Browse the repository at this point in the history
checkstack reports report_deco_status(), report_ccb_status() as
particularly excessive stack users.  Move their lookup tables
off the stack and put them in .rodata.

Signed-off-by: Kim Phillips <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
kimphill authored and herbertx committed Apr 25, 2013
1 parent 66b3e88 commit 96aef9a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/crypto/caam/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static void report_jump_idx(u32 status, char *outstr)

static void report_ccb_status(u32 status, char *outstr)
{
char *cha_id_list[] = {
static const char * const cha_id_list[] = {
"",
"AES",
"DES",
Expand All @@ -51,7 +51,7 @@ static void report_ccb_status(u32 status, char *outstr)
"ZUCE",
"ZUCA",
};
char *err_id_list[] = {
static const char * const err_id_list[] = {
"No error.",
"Mode error.",
"Data size error.",
Expand All @@ -69,7 +69,7 @@ static void report_ccb_status(u32 status, char *outstr)
"Invalid CHA combination was selected",
"Invalid CHA selected.",
};
char *rng_err_id_list[] = {
static const char * const rng_err_id_list[] = {
"",
"",
"",
Expand Down Expand Up @@ -117,7 +117,7 @@ static void report_jump_status(u32 status, char *outstr)

static void report_deco_status(u32 status, char *outstr)
{
const struct {
static const struct {
u8 value;
char *error_text;
} desc_error_list[] = {
Expand Down Expand Up @@ -245,7 +245,7 @@ static void report_cond_code_status(u32 status, char *outstr)

char *caam_jr_strstatus(char *outstr, u32 status)
{
struct stat_src {
static const struct stat_src {
void (*report_ssed)(u32 status, char *outstr);
char *error;
} status_src[] = {
Expand Down

0 comments on commit 96aef9a

Please sign in to comment.