Skip to content

Commit

Permalink
trace: remove unnecessary write_to_buffer() typecasting
Browse files Browse the repository at this point in the history
The buffer argument is void* so it is not necessary to cast.

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
  • Loading branch information
Harsh Prateek Bora authored and Stefan Hajnoczi committed Aug 14, 2012
1 parent 8ae601e commit 83d35d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions trace/simple.c
Expand Up @@ -235,9 +235,9 @@ int trace_record_start(TraceBufferRecord *rec, TraceEventID event, size_t datasi
rec->next_tbuf_idx = new_idx % TRACE_BUF_LEN;

rec_off = idx;
rec_off = write_to_buffer(rec_off, (uint8_t*)&event, sizeof(event));
rec_off = write_to_buffer(rec_off, (uint8_t*)&timestamp_ns, sizeof(timestamp_ns));
rec_off = write_to_buffer(rec_off, (uint8_t*)&rec_len, sizeof(rec_len));
rec_off = write_to_buffer(rec_off, &event, sizeof(event));
rec_off = write_to_buffer(rec_off, &timestamp_ns, sizeof(timestamp_ns));
rec_off = write_to_buffer(rec_off, &rec_len, sizeof(rec_len));

rec->tbuf_idx = idx;
rec->rec_off = (idx + sizeof(TraceRecord)) % TRACE_BUF_LEN;
Expand Down

0 comments on commit 83d35d3

Please sign in to comment.