Re: __initdata query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 14 Mar 2008, Davide Madrisan wrote:

> > are you sure about the above?  can you point at a sample source file
> > somewhere in the kernel tree that allows __initdata to be applied to
> > module parameters?  i've just never seen that.  maybe i haven't looked
> > hard enough.
>
> I've found a few examples (linux 2.6.23):
>
> drivers/char/agp/amd64-agp.c
> drivers/char/hw_random/intel-rng.c
> drivers/char/watchdog/sa1100_wdt.c
> drivers/s390/block/xpram.c
> drivers/scsi/gdth.c
> drivers/video/vfb.c
>
> and
>
> sound/oss/ad1848.c
> sound/oss/aedsp16.c
> sound/oss/msnd_pinnacle.c
> sound/oss/pas2_card.c
> sound/oss/pss.c
> sound/oss/sb_card.c
> sound/oss/sscape.c
> sound/oss/trix.c
> sound/oss/uart6850.c
> sound/oss/waveartist.c
>
> But perhaps it is not a good practice.

hmmmmmm ... i'm not sure if it's good practice or not since it's not
clear how __initdata applies to module parameters.  it's easy to see
how it would apply to, say, static data within a module source file
where that data is required only during the load phase.  once loading
is done, toss that data.  piece of cake.

but don't module parameters need to stick around after loading, say to
display their values under the /sys filesystem?  i don't know the
answer to this, i'm only asking.  because i also did a scan of the
source tree and i didn't see a lot of module source files declaring
their module params as __initdata.

can someone clarify this?  thanks.

rday

p.s.  i have to believe there's something funny happening here since,
if __initdata could be applied to module params, i would have expected
a *lot* more files doing that.

--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux