Skip to content

Commit

Permalink
[media] s5p-csis: Correct the event counters logging
Browse files Browse the repository at this point in the history
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: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Dec 21, 2012
1 parent 1bc05e7 commit ef2c832
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/media/platform/s5p-fimc/mipi-csis.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,12 @@ static void s5pcsis_log_counters(struct csis_state *state, bool non_errors)

spin_lock_irqsave(&state->slock, flags);

for (i--; i >= 0; i--)
if (state->events[i].counter >= 0)
for (i--; i >= 0; i--) {
if (state->events[i].counter > 0 || debug)
v4l2_info(&state->sd, "%s events: %d\n",
state->events[i].name,
state->events[i].counter);

}
spin_unlock_irqrestore(&state->slock, flags);
}

Expand Down

0 comments on commit ef2c832

Please sign in to comment.