weston-log-flight-rec: Fix useless comparison when displaying the
authorMarius Vlad <marius.vlad@collabora.com>
Wed, 7 Aug 2019 14:21:49 +0000 (17:21 +0300)
committerDaniel Stone <daniel@fooishbar.org>
Mon, 25 Nov 2019 20:29:49 +0000 (20:29 +0000)
contents of the flight recorder

The overlap variable is sufficient to determine from where to start
displaying the contents of the ring buffer. Also redundant to verify
if the position in the buffer went over the maximum size.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
libweston/weston-log-flight-rec.c

index 17aca1487817a011c65fea75d8534225860fc81e..31ea30454c192ca1c0c02c31645f845ba1a2c469 100644 (file)
@@ -194,7 +194,7 @@ weston_log_subscriber_display_flight_rec_data(struct weston_ring_buffer *rb,
        if (file)
                file_d = file;
 
-       if (rb->append_pos <= rb->size && !rb->overlap) {
+       if (!rb->overlap) {
                if (rb->append_pos)
                        fwrite(rb->buf, sizeof(char), rb->append_pos, file_d);
                else