提交 231be4e9 编写于 作者: A Adam Baker 提交者: John W. Linville

rt2x00: correct address calc for queue private data

When calculating the offset to add to the queue entry base to get the
individual entry's private data area the base address must be treated
as a char * not a struct queue_entry so we can do byte oriented
pointer arithmetic with it.
Signed-off-by: NAdam Baker <linux@baker-net.org.uk>
Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 16938a24
...@@ -160,7 +160,8 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue, ...@@ -160,7 +160,8 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue,
return -ENOMEM; return -ENOMEM;
#define QUEUE_ENTRY_PRIV_OFFSET(__base, __index, __limit, __esize, __psize) \ #define QUEUE_ENTRY_PRIV_OFFSET(__base, __index, __limit, __esize, __psize) \
( (__base) + ((__limit) * (__esize)) + ((__index) * (__psize)) ) ( ((char *)(__base)) + ((__limit) * (__esize)) + \
((__index) * (__psize)) )
for (i = 0; i < queue->limit; i++) { for (i = 0; i < queue->limit; i++) {
entries[i].flags = 0; entries[i].flags = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册