Skip to content

Commit

Permalink
tracing/ring-buffer: remove unused ring_buffer size
Browse files Browse the repository at this point in the history
Impact: remove dead code

struct ring_buffer.size is not set after ring_buffer is initialized
or resized. it is always 0.

we can use "buffer->pages * PAGE_SIZE" to get ring_buffer's size

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Lai Jiangshan authored and Ingo Molnar committed Dec 18, 2008
1 parent 4087449 commit 6d102bc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ struct ring_buffer_per_cpu {
};

struct ring_buffer {
unsigned long size;
unsigned pages;
unsigned flags;
int cpus;
Expand Down Expand Up @@ -2210,8 +2209,7 @@ int ring_buffer_swap_cpu(struct ring_buffer *buffer_a,
return -EINVAL;

/* At least make sure the two buffers are somewhat the same */
if (buffer_a->size != buffer_b->size ||
buffer_a->pages != buffer_b->pages)
if (buffer_a->pages != buffer_b->pages)
return -EINVAL;

cpu_buffer_a = buffer_a->buffers[cpu];
Expand Down

0 comments on commit 6d102bc

Please sign in to comment.