scsi: aic79xx: make read-only array tok_list static const
Subsystems (3)
PATCH 1/1 scsi: aic79xx: make read-only array tok_list static const
Don't populate the read-only array tok_list on the stack but instead make it static const. Also makes the object code a little smaller.
Signed-off-by Colin Ian King <[email protected]>
--- drivers/scsi/aic7xxx/aic79xx_osm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aic7xxx/aic79xx_osm.c +1 -1
@@ -1044,7 +1044,7 @@ ahd_parse_brace_option(char *opt_name, char *opt_arg, char *end, int depth,int instance;int targ;int done; -char tok_list[] = {'.' ,',' ,'{' ,'}' ,'\0' }; +static const char tok_list[] = {'.' ,',' ,'{' ,'}' ,'\0' };/* All options use a ':' name/arg separator */ if (*opt_arg !=':' )
Signature · 1 line
2.35.3
Quoted 13 lines · Colin Ian King
Don't populate the read-only array
tok_liston the stack but instead make it static const. Also makes the object code a little smaller.Signed-off-by Colin Ian King <[email protected]>--- drivers/scsi/aic7xxx/aic79xx_osm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/aic7xxx/aic79xx_osm.c +0
-0
drivers/scsi/aic7xxx/aic79xx_osm.c ahd_parse_brace_option(char *opt_name, char *opt_arg, char *end, int depth, · line 1047
Quoted 5 lines
drivers/scsi/aic7xxx/aic79xx_osm.c +1
-1@@ -1044,7 +1044,7 @@ ahd_parse_brace_option(char *opt_name, char *opt_arg, char *end, int depth,int instance;int targ;int done; -char tok_list[] = {'.' ,',' ,'{' ,'}' ,'\0' }; +static const char tok_list[] = {'.' ,',' ,'{' ,'}' ,'\0' };
Has it been considered to write the above code as follows?
static const char tok_list[] = ".,{}";
Thanks,
Bart.