diff mbox series

[2/5] trace-cmd library: Remove useless check before applying ts offset

Message ID 20210428122839.805296-3-tz.stoyanov@gmail.com (mailing list archive)
State Accepted
Commit 9dbd7182dba66ecc113ebe7012a6dfe53fc7bf81
Headers show
Series [1/5] trace-cmd: Remove ts offset from tsc2nsec conversion | expand

Commit Message

Tzvetomir Stoyanov (VMware) April 28, 2021, 12:28 p.m. UTC
Checking if offset is non-zero before adding to the timestamp is useless,
as adding 0 will not change the timestamp.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 lib/trace-cmd/trace-input.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index e8a257db..bacf9ccf 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -1323,8 +1323,7 @@  static unsigned long long timestamp_calc(unsigned long long ts, int cpu,
 	}
 
 	/* User specified time offset with --ts-offset or --date options */
-	if (handle->ts_offset)
-		ts += handle->ts_offset;
+	ts += handle->ts_offset;
 
 	return ts;
 }