Skip to content

Commit

Permalink
modpost: simplify file name generation of *.mod.c files
Browse files Browse the repository at this point in the history
Avoid the variable length array (vla), just use PATH_MAX instead.
This not only makes this code clang friedly, it also leads to a
code size reduction:

   text    data     bss     dec     hex filename
  51765    2224   12416   66405   10365 scripts/mod/modpost.old
  51677    2224   12416   66317   1030d scripts/mod/modpost.new

Signed-off-by: Mathias Krause <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
minipli authored and rustyrussell committed Aug 27, 2014
1 parent 7a3ee75 commit d93e171
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -2212,7 +2212,7 @@ int main(int argc, char **argv)
err = 0;

for (mod = modules; mod; mod = mod->next) {
char fname[strlen(mod->name) + 10];
char fname[PATH_MAX];

if (mod->skip)
continue;
Expand Down

0 comments on commit d93e171

Please sign in to comment.