[RFC 6/9] backports: revert DMI_EXACT_MATCH() for older kernels

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

 



From: "Luis R. Rodriguez" <mcgrof@xxxxxxxxxxxxxxxx>

struct dmi_strmatch was modified on v3.11 with a
exact_match member. The DMI_EXACT_MATCH() macro was
added as a mod version of DMI_MATCH() to account for
dmi strings that look closely like each other. An
example is D510MO Vs D510MOV.

Since exact_match is is not available on older kernels
we can't use it and must revert to the old DMI_MATCH().
Addressing the desired behaviour will require a separate
change to deal with addressing the difference
in the behaviour.

I welcome alternative ideas.

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 5017b285
v3.11-rc1~99^2~254

commit 5017b2851373ee15c7035151853bb1448800cae2
Author: Jani Nikula <jani.nikula@xxxxxxxxx>
Date:   Wed Jul 3 15:05:02 2013 -0700

    dmi: add support for exact DMI matches in addition to substring matching

    dmi_match() considers a substring match to be a successful match.  This is
    not always sufficient to distinguish between DMI data for different
    systems.  Add support for exact string matching using strcmp() in addition
    to the substring matching using strstr().

    The specific use case in the i915 driver is to allow us to use an exact
    match for D510MO, without also incorrectly matching D510MOV:

      {
        .ident = "Intel D510MO",
        .matches = {
                DMI_MATCH(DMI_BOARD_VENDOR, "Intel"),
                DMI_EXACT_MATCH(DMI_BOARD_NAME, "D510MO"),
        },
      }

    Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
    Cc: <annndddrr@xxxxxxxxx>
    Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
    Cc: Cornel Panceac <cpanceac@xxxxxxxxx>
    Acked-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
    Cc: Greg KH <greg@xxxxxxxxx>
    Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

Cc: jani.nikula@xxxxxxxxx
Cc: annndddrr@xxxxxxxxx
Cc: chris@xxxxxxxxxxxxxxxxxx
Cc: cpanceac@xxxxxxxxx
Cc: daniel.vetter@xxxxxxxx
Cc: greg@xxxxxxxxx
Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx>
---
 backport/backport-include/linux/mod_devicetable.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/backport/backport-include/linux/mod_devicetable.h b/backport/backport-include/linux/mod_devicetable.h
index 1f85ce6..5b63637 100644
--- a/backport/backport-include/linux/mod_devicetable.h
+++ b/backport/backport-include/linux/mod_devicetable.h
@@ -2,6 +2,10 @@
 #define __BACKPORT_MOD_DEVICETABLE_H
 #include_next <linux/mod_devicetable.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
+#define DMI_EXACT_MATCH(a, b)  { a, b }
+#endif
+
 #ifndef HID_BUS_ANY
 #define HID_BUS_ANY                            0xffff
 #endif
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux