diff options
author | 2021-03-14 04:48:25 +0900 | |
---|---|---|
committer | 2021-03-25 13:34:37 +0900 | |
commit | ed562c53104fbe097f012bec5a30196334e52d78 (patch) | |
tree | b6be38930e3f0dea9dcddaa55bc62f5657bf70a1 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | kconfig: split randconfig setup code into set_randconfig_seed() (diff) | |
download | wireguard-linux-ed562c53104fbe097f012bec5a30196334e52d78.tar.xz wireguard-linux-ed562c53104fbe097f012bec5a30196334e52d78.zip |
kconfig: refactor option parse code
The current option parse code is clumsy.
The 's' option is separately handled in an if-conditional due to the
following code:
input_mode = (enum input_mode)opt;
If 's' is moved to the switch statement, the invalid value 's' would
be assigned to the input_mode.
Another potential problem is that we are mixing 'enum input_mode' and
ASCII characters. They could overwrap if we add more input modes.
To separate them out, set the flag field of long options to a pointer
of input_mode_opt. For mode select options, getopt_long() returns 0,
which never causes overwrap with ASCII characters that represent short
options.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions