public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Rodolfo Giometti <giometti@enneenne.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PXA27x UDC driver.
Date: Sun, 1 Jul 2007 10:49:41 -0700	[thread overview]
Message-ID: <200707011049.42333.david-b@pacbell.net> (raw)
In-Reply-To: <20070701150036.GA20518@flint.arm.linux.org.uk>

On Sunday 01 July 2007, Russell King - ARM Linux wrote:
> >  
> > +#ifdef CONFIG_USB_GADGET_PXA27X
> > +#define DEV_CONFIG_SUBSET
> > +#endif
> > +
> 
> Bad - can we not make this runtime dependent?

The #define controls which descriptors are statically linked
into every object.  I suppose someone could submit a patch which
does that differently ... I'm not keen on having lots of "will
never use" data bloating any driver, but it could be moved to
__initdata, at the cost of adding code to kmalloc (and kfree)
all the individual descriptors.  Restricting code bloat to init
sections would still be worse than no bloat...


> > +static void *pxa27x_ep_alloc_buffer(struct usb_ep *_ep, unsigned bytes,
> > +				    dma_addr_t * dma, unsigned int gfp_flags)
> > +{
> > +	...
> 
> Err, no.  There's a perfectly good replacement.  DMA pools.  Please use
> the provided infrastructure instead of inventing your own solution.

This was cloned from code which predates dma pools.  :)

Regardless, I'm planning to remove that interface from the gadget stack.
It's utility is far exceeded by the number of controller driver bugs
in that area.  Plus, if any gadget driver needs such a mechanism, the
dma_pool stuff that now exists could be called directly.


> Pointers which are cleared are set to NULL not zero.  Zero is an integer.
> NULL is a pointer.  Don't confuse the two.

ISTR this class of error would be reported by sparse ("make check").

- Dave

      reply	other threads:[~2007-07-01 18:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-28 10:36 [PATCH] PXA27x UDC driver Rodolfo Giometti
2007-06-28 11:15 ` Li Yang-r58472
2007-06-28 14:12   ` Rodolfo Giometti
2007-06-28 21:29     ` Andrew Morton
2007-06-28 22:44       ` David Brownell
2007-06-30 14:28       ` [linux-usb-devel] " David Brownell
2007-07-10 15:49       ` Rodolfo Giometti
2007-07-10 16:16         ` Lothar Wassmann
2007-06-28 21:53     ` David Brownell
2007-06-29  8:58       ` Rodolfo Giometti
2007-06-29  9:33         ` [linux-usb-devel] " Dmitry Krivoschekov
2007-06-30 14:25         ` David Brownell
2007-06-29  9:03       ` [linux-usb-devel] " Dmitry Krivoschekov
2007-06-30 13:46         ` David Brownell
2007-07-02 11:42           ` Dmitry Krivoschekov
2007-07-09 13:51           ` Rodolfo Giometti
2007-07-10 14:50             ` Vernon Sauder
2007-07-10 18:16             ` David Brownell
2007-06-29 17:04 ` Andy Isaacson
2007-07-01 14:55 ` Lennert Buytenhek
2007-07-01 15:00 ` Russell King - ARM Linux
2007-07-01 17:49   ` David Brownell [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=200707011049.42333.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=akpm@linux-foundation.org \
    --cc=giometti@enneenne.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /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