lkml.org 
[lkml]   [2007]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: drivers/net/wireless/rt2x00/: struct data_desc strangeness
Date
From
Hi,

> > > I haven't checked whether it might work in all cases, but passing
> > > non-zero values as second parameter to rt2x00_desc_{read,write}()
> > > (as is done in many cases) is even in the best case bad coding style.
> >
> > Access to the array is correct, even with non-zero values the code that is
> > reading/writing to the array knows the exact size of the descriptor. Within
> > rt2x00 are however 5 drivers who have different descriptor sizes. That means
> > I can't create a structure which has the correct array length.
> >
> > The structure itself is just a simple map over preallocated memory
> > (skb->data in case of USB or dma in case of PCI).
> >
> > So possible solutions would be:
> > - remove struct data_desc and make it a void* or __le32*
> > This is at the cost of code readibility since the above pointers
> > have less meaning then a pointer to a structure which can be nicely
> > documented.
> >...
>
> The worst is a wrong meaning.
> __le32 word[1] is an array with _one_ element.
>
> And an __le32* can be used as an array.

Ok. I'll fix this in 1 or 2 days.

Ivo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-10-23 21:57    [W:0.049 / U:0.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site