All of lore.kernel.org
 help / color / mirror / Atom feed
* const __initdata?
@ 2007-11-29  7:28 Robert P. J. Day
  2007-11-29 16:53 ` Randy Dunlap
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Robert P. J. Day @ 2007-11-29  7:28 UTC (permalink / raw)
  To: kernel-janitors


  from include/linux/init.h:

 * For initialized data:
 * You should insert __initdata between the variable name and equal
 * sign followed by value, e.g.:
 *
 * static int init_variable __initdata = 0;
 * static char linux_logo[] __initdata = { 0x32, 0x36, ... };
 *
 * Don't forget to initialize data not at file scope, i.e. within a function,
 * as gcc otherwise puts the data into the bss section and not into the init
 * section.
 *
 * Also note, that this data cannot be "const".

you mean, like this in drivers/hwmon/w83627ehf.c:

/* w83627ehf_find() looks for a '627 in the Super-I/O config space */
static int __init w83627ehf_find(int sioaddr, unsigned short *addr,
                                 struct w83627ehf_sio_data *sio_data)
{
        static const char __initdata sio_name_W83627EHF[] = "W83627EHF";
        static const char __initdata sio_name_W83627EHG[] = "W83627EHG";
        static const char __initdata sio_name_W83627DHG[] = "W83627DHG";
	...

or am i misreading that?

rday

====================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
====================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-01  0:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-29  7:28 const __initdata? Robert P. J. Day
2007-11-29 16:53 ` Randy Dunlap
2007-11-30 17:08 ` Robert P. J. Day
2007-11-30 17:22 ` Randy Dunlap
2007-12-01  0:20 ` Adrian Bunk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.