netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: linux-usb-devel@lists.sourceforge.net
Cc: Oliver Neukum <oliver@neukum.org>, Daniel Drake <dsd@gentoo.org>,
	netdev@vger.kernel.org, Ulrich Kunitz <kune@deine-taler.de>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [linux-usb-devel] [PATCH RFC] ZyDAS ZD1211 USB-WLAN driver
Date: Mon, 5 Jun 2006 22:41:02 -0700	[thread overview]
Message-ID: <200606052241.03845.david-b@pacbell.net> (raw)
In-Reply-To: <200606040025.32275.oliver@neukum.org>

On Saturday 03 June 2006 3:25 pm, Oliver Neukum wrote:
> Am Samstag, 3. Juni 2006 21:35 schrieb Daniel Drake:
> > Oliver Neukum wrote:
> > > +static int read_mac_addr(struct zd_chip *chip, u8 *mac_addr)
> > > +{
> > > +	static const zd_addr_t addr[2] = { CR_MAC_ADDR_P1, CR_MAC_ADDR_P2 };
> > > +	return _read_mac_addr(chip, mac_addr, (const zd_addr_t *)addr);
> > > +}
> > > 
> > > Why on the stack?
> > 
> > Technically it's not on the stack because it is static const (it goes in 
> > rodata), but I don't think that this invalidates your point. What's the 
> > alternative? kmalloc and kfree every time?
> 
> In this case rodata will work. However, if you ever switch to direct DMA
> it will fail. I really did overlook the const keyword.

On some platforms rodata will work; but it's not guaranteed on any.
See Documentation/DMA-mapping.txt and read the little section at the
top explaining what types of memory can be DMA'd from ... neither stack,
nor BSS, nor data, nor rodata, nor text are OK.

- Dave

  parent reply	other threads:[~2006-06-06  5:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-03 11:20 [PATCH RFC] ZyDAS ZD1211 USB-WLAN driver Daniel Drake
2006-06-03 17:51 ` [linux-usb-devel] " Oliver Neukum
2006-06-03 19:35   ` Daniel Drake
2006-06-03 22:25     ` Oliver Neukum
2006-06-04 16:29       ` John Que
2006-06-04 17:17         ` Oliver Neukum
2006-06-04 18:03           ` Rami Rosen
2006-06-04 21:51             ` Daniel Drake
2006-06-04 18:22           ` John Que
2006-06-04 19:06             ` Oliver Neukum
2006-06-04 21:45         ` Daniel Drake
2006-06-06  5:41       ` David Brownell [this message]
2006-06-10 11:23       ` Ulrich Kunitz
2006-06-10 11:49         ` Oliver Neukum
2006-06-10 12:40         ` [linux-usb-devel] " Daniel Drake
2006-06-10 19:37   ` Daniel Drake

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=200606052241.03845.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=dsd@gentoo.org \
    --cc=kune@deine-taler.de \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=oliver@neukum.org \
    /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).