From: Marius Vlad Date: Wed, 7 Aug 2019 14:21:49 +0000 (+0300) Subject: weston-log-flight-rec: Fix useless comparison when displaying the X-Git-Tag: upstream/9.0.0~239 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2dbcd3d7ee87bbfc55e55dd66c226bf4be9d583;p=platform%2Fupstream%2Fweston.git 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 --- 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