From: Ivo van Doorn <ivdoorn@gmail.com>
To: Adrian Bunk <bunk@kernel.org>
Cc: "John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: drivers/net/wireless/rt2x00/: struct data_desc strangeness
Date: Tue, 23 Oct 2007 22:13:46 +0200 [thread overview]
Message-ID: <200710232213.47105.IvDoorn@gmail.com> (raw)
In-Reply-To: <20071023194344.GX30533@stusta.de>
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
prev parent reply other threads:[~2007-10-23 19:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-14 17:50 drivers/net/wireless/rt2x00/: struct data_desc strangeness Adrian Bunk
2007-10-14 19:06 ` Ivo van Doorn
2007-10-23 19:43 ` Adrian Bunk
2007-10-23 20:13 ` Ivo van Doorn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200710232213.47105.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=bunk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).