Re: __initdata and struct dmi_system_id? [w/PATCH]

Previous thread: [PATCH] NFS: Restore missing hunk in NFS mount option parser by Chuck Lever on Monday, September 8, 2008 - 8:58 am. (1 message)

Next thread: [PATCH] kernel/cpu.c: create a CPU_STARTING cpu_chain notifier by Manfred Spraul on Sunday, September 7, 2008 - 7:57 am. (3 messages)
From: Helge Deller
Date: Monday, September 8, 2008 - 9:46 am

Easiest and cleanest way for the dmi_system_id arrays is probably the
attached patch.

There are two downsides though:
1. It makes the inital kernel image bigger than needed (even if the memory
itself is freed later)
2. We have to make sure, that the string lengths fit into the given array
limits (else you get the compiler warning "initializer-string for array of
chars is too long")

I haven't tested how much memory this really saves.

please CC me on replies!

----------

Patch: store DMI const strings in __initdata section

Signed-off-by: Helge Deller <deller@gmx.de>

--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -53,12 +53,12 @@ struct dmi_header {
  */
 struct dmi_strmatch {
        u8 slot;
-       char *substr;
+       char substr[48];
 };
 
 struct dmi_system_id {
        int (*callback)(const struct dmi_system_id *);
-       const char *ident;
+       char ident[88];
        struct dmi_strmatch matches[4];
        void *driver_data;
 };

--

Previous thread: [PATCH] NFS: Restore missing hunk in NFS mount option parser by Chuck Lever on Monday, September 8, 2008 - 8:58 am. (1 message)

Next thread: [PATCH] kernel/cpu.c: create a CPU_STARTING cpu_chain notifier by Manfred Spraul on Sunday, September 7, 2008 - 7:57 am. (3 messages)