Skip to content
Snippets Groups Projects
Commit af1da7e3 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

log: cleanup

parent f80c3bd0
No related branches found
No related tags found
No related merge requests found
......@@ -115,7 +115,7 @@ static uint8_t sink_levels(struct log_sink *log, int facility, logsrc_t src)
assert(log);
// Check facility
if (knot_unlikely(!log->facility_count || facility >= log->facility_count)) {
if (knot_unlikely(log->facility_count == 0 || facility >= log->facility_count)) {
return 0;
}
......@@ -125,7 +125,7 @@ static uint8_t sink_levels(struct log_sink *log, int facility, logsrc_t src)
static int sink_levels_set(struct log_sink *log, int facility, logsrc_t src, uint8_t levels)
{
// Check facility
if (knot_unlikely(!log->facility_count || facility >= log->facility_count)) {
if (knot_unlikely(log->facility_count == 0 || facility >= log->facility_count)) {
return KNOT_EINVAL;
}
......@@ -196,7 +196,8 @@ bool log_isopen()
static int log_open_file(struct log_sink *log, const char* filename)
{
// Check facility
if (knot_unlikely(!log->facility_count || LOGT_FILE + log->file_count >= log->facility_count)) {
if (knot_unlikely(log->facility_count == 0 ||
LOGT_FILE + log->file_count >= log->facility_count)) {
return KNOT_ERROR;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment