[media] s5p-csis: Correct the event counters logging
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Fri, 23 Nov 2012 18:17:40 +0000 (15:17 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 21 Dec 2012 13:58:42 +0000 (11:58 -0200)
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>
drivers/media/platform/s5p-fimc/mipi-csis.c

index 4c961b1b68e6004ab1dd98d578b0e6cc407e97f9..9528ee65a84351916f7fa06dfafc6b9f9072806b 100644 (file)
@@ -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);
 }