logger: convert: Code quality improvements

The precision check condition has been simplified, the unsigned value
cannot be negative. Added definitions containing an error message instead
of using a constant variable.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
This commit is contained in:
Adrian Warecki 2023-09-18 15:37:12 +02:00 committed by Liam Girdwood
parent 30a2855d48
commit 56a1352163
1 changed files with 2 additions and 3 deletions

View File

@ -60,8 +60,7 @@ struct proc_ldc_entry {
uintptr_t params[TRACE_MAX_PARAMS_COUNT];
};
static const char *BAD_PTR_STR = "<bad uid ptr 0x%.8x>";
#define BAD_PTR_STR "<bad uid ptr 0x%.8x>"
#define UUID_LOWER "%s%s%s<%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x>%s%s%s"
#define UUID_UPPER "%s%s%s<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>%s%s%s"
@ -325,7 +324,7 @@ static unsigned int timestamp_width(unsigned int precision)
* gcc 9.3, this avoids a very long precision causing snprintf()
* to truncate time_fmt
*/
assert(precision >= 0 && precision < 20);
assert(precision < 20);
/*
* 12 digits for units is enough for 1M seconds = 11 days which
* should be enough for most test runs.