mirror of https://github.com/thesofproject/sof.git
logger: Fix log level parsing
Usage of strstr for short version of logs level definitions
(for example 'e') leads to invalid level parsing, because first
log level with defined string (or letter) will be returned
(in this example 'verbose').
After change, log level will be returned only when name is
exactly as given one.
Fixes: b1fc9220
(logger: Parse runtime filter levels)
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This commit is contained in:
parent
692cfa9305
commit
60141f2074
|
@ -82,7 +82,7 @@ static int filter_parse_log_level(const char *value_start)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(log_level_dict); ++i) {
|
for (i = 0; i < ARRAY_SIZE(log_level_dict); ++i) {
|
||||||
if (strstr(log_level_dict[i].name, value_start))
|
if (!strcmp(log_level_dict[i].name, value_start))
|
||||||
return log_level_dict[i].log_level;
|
return log_level_dict[i].log_level;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue