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:
Karol Trzcinski 2020-08-27 07:40:19 +02:00 committed by Liam Girdwood
parent 692cfa9305
commit 60141f2074
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ static int filter_parse_log_level(const char *value_start)
int 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 -1;