Skip to content

Commit

Permalink
rt2x00: correct address calc for queue private data
Browse files Browse the repository at this point in the history
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: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Adam Baker authored and John W. Linville committed Feb 29, 2008
1 parent 16938a2 commit 231be4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/wireless/rt2x00/rt2x00queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue,
return -ENOMEM;

#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++) {
entries[i].flags = 0;
Expand Down

0 comments on commit 231be4e

Please sign in to comment.