crypto: caam - static constify error data
authorKim Phillips <kim.phillips@freescale.com>
Tue, 26 Mar 2013 23:10:15 +0000 (18:10 -0500)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 25 Apr 2013 13:01:43 +0000 (21:01 +0800)
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 <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/error.c

index 30b8f74..9f25f52 100644 (file)
@@ -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",
@@ -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.",
@@ -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[] = {
                "",
                "",
                "",
@@ -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[] = {
@@ -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[] = {