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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>
Cc: <linux-input@...>
Date: Monday, September 8, 2008 - 12:46 pm

Németh Márton wrote:

Yes, you did.


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 message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: __initdata and struct dmi_system_id? [w/PATCH], Helge Deller, (Mon Sep 8, 12:46 pm)