From: Greg Kroah-Hartman Date: Tue, 26 Jan 2010 00:47:48 +0000 (-0800) Subject: another .32 patch X-Git-Tag: v2.6.32.7~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=288ac7ead72a3dde58fdd624c31e6458cbe2013c;p=thirdparty%2Fkernel%2Fstable-queue.git another .32 patch --- diff --git a/queue-2.6.32/dmi-allow-omitting-ident-strings-in-dmi-tables.patch b/queue-2.6.32/dmi-allow-omitting-ident-strings-in-dmi-tables.patch new file mode 100644 index 00000000000..54cb4423977 --- /dev/null +++ b/queue-2.6.32/dmi-allow-omitting-ident-strings-in-dmi-tables.patch @@ -0,0 +1,71 @@ +From 75757507e014fa074d25d2883c4ab604999584bd Mon Sep 17 00:00:00 2001 +From: Dmitry Torokhov +Date: Fri, 4 Dec 2009 10:24:19 -0800 +Subject: DMI: allow omitting ident strings in DMI tables + +From: Dmitry Torokhov + +commit 75757507e014fa074d25d2883c4ab604999584bd upstream. + +The purpose of dmi->ident is twofold - it may be used by DMI callback +functions when composing log messages; it is also used to determine +end of DMI table in dmi_check_system() and dmi_first_match(). However, +in case when callbacks are not interested in using ident at all it just +wastes memory. Let's make entries with empty first match slot serve as +end-of-table markers instead. + +[needed for DMI table changes that need to be done by later patches - gkh] + +Acked-by: Jean Delvare +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/firmware/dmi_scan.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +--- a/drivers/firmware/dmi_scan.c ++++ b/drivers/firmware/dmi_scan.c +@@ -429,7 +429,7 @@ static bool dmi_matches(const struct dmi + for (i = 0; i < ARRAY_SIZE(dmi->matches); i++) { + int s = dmi->matches[i].slot; + if (s == DMI_NONE) +- continue; ++ break; + if (dmi_ident[s] + && strstr(dmi_ident[s], dmi->matches[i].substr)) + continue; +@@ -440,6 +440,15 @@ static bool dmi_matches(const struct dmi + } + + /** ++ * dmi_is_end_of_table - check for end-of-table marker ++ * @dmi: pointer to the dmi_system_id structure to check ++ */ ++static bool dmi_is_end_of_table(const struct dmi_system_id *dmi) ++{ ++ return dmi->matches[0].slot == DMI_NONE; ++} ++ ++/** + * dmi_check_system - check system DMI data + * @list: array of dmi_system_id structures to match against + * All non-null elements of the list must match +@@ -457,7 +466,7 @@ int dmi_check_system(const struct dmi_sy + int count = 0; + const struct dmi_system_id *d; + +- for (d = list; d->ident; d++) ++ for (d = list; !dmi_is_end_of_table(d); d++) + if (dmi_matches(d)) { + count++; + if (d->callback && d->callback(d)) +@@ -484,7 +493,7 @@ const struct dmi_system_id *dmi_first_ma + { + const struct dmi_system_id *d; + +- for (d = list; d->ident; d++) ++ for (d = list; !dmi_is_end_of_table(d); d++) + if (dmi_matches(d)) + return d; + diff --git a/queue-2.6.32/series b/queue-2.6.32/series index 70436186db4..74772eaf9f8 100644 --- a/queue-2.6.32/series +++ b/queue-2.6.32/series @@ -57,6 +57,7 @@ qlge-don-t-fail-open-when-port-is-not-initialized.patch qlge-add-handler-for-dcbx-firmware-event.patch qlge-bonding-fix-for-mode-6.patch pci-aer-fix-aer-inject-result-in-kernel-oops.patch +dmi-allow-omitting-ident-strings-in-dmi-tables.patch input-i8042-remove-identification-strings-from-dmi-tables.patch input-i8042-add-gigabyte-m1022m-to-the-noloop-list.patch input-i8042-add-dritek-quirk-for-acer-aspire-5610.patch