|
65 | 65 | # git output parsing needs US English output, so first set backtick child process LANGUAGE
|
66 | 66 | my $git_command ='export LANGUAGE=en_US.UTF-8; git';
|
67 | 67 | my $tabsize = 8;
|
| 68 | +my ${CONFIG_} = "CONFIG_"; |
68 | 69 |
|
69 | 70 | sub help {
|
70 | 71 | my ($exitcode) = @_;
|
@@ -127,6 +128,8 @@ sub help {
|
127 | 128 | --typedefsfile Read additional types from this file
|
128 | 129 | --color[=WHEN] Use colors 'always', 'never', or only when output
|
129 | 130 | is a terminal ('auto'). Default is 'auto'.
|
| 131 | + --kconfig-prefix=WORD use WORD as a prefix for Kconfig symbols (default |
| 132 | + ${CONFIG_}) |
130 | 133 | -h, --help, --version display this help and exit
|
131 | 134 |
|
132 | 135 | When FILE is - read standard input.
|
@@ -235,6 +238,7 @@ sub list_types {
|
235 | 238 | 'color=s' => \$color,
|
236 | 239 | 'no-color' => \$color, #keep old behaviors of -nocolor
|
237 | 240 | 'nocolor' => \$color, #keep old behaviors of -nocolor
|
| 241 | + 'kconfig-prefix=s' => \${CONFIG_}, |
238 | 242 | 'h|help' => \$help,
|
239 | 243 | 'version' => \$help
|
240 | 244 | ) or help(1);
|
@@ -6524,16 +6528,16 @@ sub process {
|
6524 | 6528 | }
|
6525 | 6529 |
|
6526 | 6530 | # check for IS_ENABLED() without CONFIG_<FOO> ($rawline for comments too)
|
6527 |
| - if ($rawline =~ /\bIS_ENABLED\s*\(\s*(\w+)\s*\)/ && $1 !~ /^CONFIG_/) { |
| 6531 | + if ($rawline =~ /\bIS_ENABLED\s*\(\s*(\w+)\s*\)/ && $1 !~ /^${CONFIG_}/) { |
6528 | 6532 | WARN("IS_ENABLED_CONFIG",
|
6529 |
| - "IS_ENABLED($1) is normally used as IS_ENABLED(CONFIG_$1)\n" . $herecurr); |
| 6533 | + "IS_ENABLED($1) is normally used as IS_ENABLED(${CONFIG_}$1)\n" . $herecurr); |
6530 | 6534 | }
|
6531 | 6535 |
|
6532 | 6536 | # check for #if defined CONFIG_<FOO> || defined CONFIG_<FOO>_MODULE
|
6533 |
| - if ($line =~ /^\+\s*#\s*if\s+defined(?:\s*\(?\s*|\s+)(CONFIG_[A-Z_]+)\s*\)?\s*\|\|\s*defined(?:\s*\(?\s*|\s+)\1_MODULE\s*\)?\s*$/) { |
| 6537 | + if ($line =~ /^\+\s*#\s*if\s+defined(?:\s*\(?\s*|\s+)(${CONFIG_}[A-Z_]+)\s*\)?\s*\|\|\s*defined(?:\s*\(?\s*|\s+)\1_MODULE\s*\)?\s*$/) { |
6534 | 6538 | my $config = $1;
|
6535 | 6539 | if (WARN("PREFER_IS_ENABLED",
|
6536 |
| - "Prefer IS_ENABLED(<FOO>) to CONFIG_<FOO> || CONFIG_<FOO>_MODULE\n" . $herecurr) && |
| 6540 | + "Prefer IS_ENABLED(<FOO>) to ${CONFIG_}<FOO> || ${CONFIG_}<FOO>_MODULE\n" . $herecurr) && |
6537 | 6541 | $fix) {
|
6538 | 6542 | $fixed[$fixlinenr] = "\+#if IS_ENABLED($config)";
|
6539 | 6543 | }
|
|
0 commit comments