Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	bzolnier@gmail.com, linux-ide@vger.kernel.org,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	linux-mips@linux-mips.org
Subject: Re: [PATCH] IDE: Fix platform device registration in Swarm IDE driver
Date: Sun, 28 Sep 2008 19:18:36 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0809281913040.5681@anakin> (raw)
In-Reply-To: <48DF7DBC.1080804@ru.mvista.com>

On Sun, 28 Sep 2008, Sergei Shtylyov wrote:
> Ralf Baechle wrote:
> 
> > > > +{
> 
> > > [...]
> 
> > > > +	pdev = platform_device_register_simple(DEV_NAME, -1,
> > > > +		       swarm_ide_resource, ARRAY_SIZE(swarm_ide_resource));
> 
> > >  If you have the resources as static array anyway, why not have the
> > > device in the static variable too and use platform_device_register()?
> 
> > It saves a few lines of code.
> 
>    And wastes few words of static data since platform_device_register_simple()
> will kmalloc() the resources and do a copy from these resources after which
> they are not needed -- so, it's worth making swarm_ide_resource[] __initdata
> at least.
>    If you were using platform_device_register() with static platform device,
> no memory allocation would have happened, and no data would have been wasted.

Indeed, there are different static/dynamic memory usage patterns for the
various ways to register platform devices. Unfortunately (AFAIK) it's not
properly documented which to use when.

E.g. if some devices may be present (as indicated by e.g. firmware),
which one is the most optimal to use?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

      reply	other threads:[~2008-09-28 17:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22 12:29 [PATCH] IDE: Fix platform device registration in Swarm IDE driver Ralf Baechle
2008-09-24 11:08 ` Sergei Shtylyov
2008-09-24 13:52   ` Maciej W. Rozycki
2008-09-27 23:51     ` Ralf Baechle
2008-09-27 16:59   ` Bartlomiej Zolnierkiewicz
2008-09-28  9:22     ` Sergei Shtylyov
2008-09-28 11:39     ` Ralf Baechle
2008-09-28 13:12       ` Sergei Shtylyov
2008-09-28 17:54       ` [PATCH v2] " Ralf Baechle
2008-09-28 21:51         ` Sergei Shtylyov
2008-09-28 21:57           ` Ralf Baechle
2008-09-29  8:00           ` Sergei Shtylyov
2008-10-03 17:00           ` Bartlomiej Zolnierkiewicz
2008-10-03 18:25             ` Ralf Baechle
2008-09-28 11:47   ` [PATCH] " Ralf Baechle
2008-09-28 12:51     ` Sergei Shtylyov
2008-09-28 17:18       ` Geert Uytterhoeven [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=Pine.LNX.4.64.0809281913040.5681@anakin \
    --to=geert@linux-m68k.org \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=sshtylyov@ru.mvista.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