Skip to content

Commit fb91616

Browse files
cs-etm: removing unecessary structure field
Function cs_etm__sample() is called only from cs_etm__run_decoder() where cs_etm_queue::have_sample is set to 'true'. As such checking the value of the variable again in cs_etm__sample() is not needed. Since the variable isn't used anywhere else, also removing it from the structure definition. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent 7b4fe2f commit fb91616

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

tools/perf/util/cs-etm.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ struct cs_etm_queue {
8383
u64 time;
8484
u64 timestamp;
8585
bool stop;
86-
bool have_sample;
8786
struct cs_etm_decoder *decoder;
8887
u64 offset;
8988
bool eot;
@@ -797,11 +796,6 @@ static int cs_etm__sample(struct cs_etm_queue *etmq)
797796
//struct cs_etm_auxtrace *etm = etmq->etm;
798797
int err;
799798

800-
if (!etmq->have_sample)
801-
return 0;
802-
803-
etmq->have_sample = false;
804-
805799
err = cs_etm_decoder__get_packet(etmq->decoder,&packet);
806800
// if there is no sample, it returns err = -1, no real error
807801

@@ -837,10 +831,8 @@ static int cs_etm__run_decoder(struct cs_etm_queue *etmq, u64 *timestamp)
837831
err = etmq->state->err;
838832
etmq->offset += processed;
839833
buffer_used += processed;
840-
if (!err) {
841-
etmq->have_sample = true;
834+
if (!err)
842835
cs_etm__sample(etmq);
843-
}
844836
} while (!etmq->eot && (buffer.len > buffer_used));
845837
goto more;
846838

0 commit comments

Comments
 (0)