From d2dbcd3d7ee87bbfc55e55dd66c226bf4be9d583 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Wed, 7 Aug 2019 17:21:49 +0300 Subject: [PATCH] weston-log-flight-rec: Fix useless comparison when displaying the 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 Reported-by: Pekka Paalanen --- libweston/weston-log-flight-rec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libweston/weston-log-flight-rec.c b/libweston/weston-log-flight-rec.c index 17aca148..31ea3045 100644 --- a/libweston/weston-log-flight-rec.c +++ b/libweston/weston-log-flight-rec.c @@ -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