Commit ef2c8326 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] s5p-csis: Correct the event counters logging

The counter field is unsigned so >= 0 condition always evaluates
to true. Fix this to log events for which counter is > 0 or for
all when in debug mode.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 1bc05e77
...@@ -401,12 +401,12 @@ static void s5pcsis_log_counters(struct csis_state *state, bool non_errors) ...@@ -401,12 +401,12 @@ static void s5pcsis_log_counters(struct csis_state *state, bool non_errors)
spin_lock_irqsave(&state->slock, flags); spin_lock_irqsave(&state->slock, flags);
for (i--; i >= 0; i--) for (i--; i >= 0; i--) {
if (state->events[i].counter >= 0) if (state->events[i].counter > 0 || debug)
v4l2_info(&state->sd, "%s events: %d\n", v4l2_info(&state->sd, "%s events: %d\n",
state->events[i].name, state->events[i].name,
state->events[i].counter); state->events[i].counter);
}
spin_unlock_irqrestore(&state->slock, flags); spin_unlock_irqrestore(&state->slock, flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment