diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-01-19 14:32:51 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-20 13:09:06 +0100 |
commit | 082605de5f82eb692cc90f7fda071cc01bb5ac34 (patch) | |
tree | f3e2536d840dff5f15e25ee609ab37a645f8fd9a /drivers/watchdog/geodewdt.c | |
parent | 1de9e8e70f5acc441550ca75433563d91b269bbe (diff) |
ring-buffer: fix alignment problem
Impact: fix to allow some archs to use the ring buffer
Commits in the ring buffer are checked by pointer arithmetic.
If the calculation is incorrect, then the commits will never take
place and the buffer will simply fill up and report an error.
Each page in the ring buffer has a small header:
struct buffer_data_page {
u64 time_stamp;
local_t commit;
unsigned char data[];
};
Unfortuntely, some of the calculations used sizeof(struct buffer_data_page)
to know the size of the header. But this is incorrect on some archs,
where sizeof(struct buffer_data_page) does not equal
offsetof(struct buffer_data_page, data), and on those archs, the commits
are never processed.
This patch replaces the sizeof with offsetof.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/watchdog/geodewdt.c')
0 files changed, 0 insertions, 0 deletions