[PATCH] loader: Remove compatibility with ancient XFree86 version numbering

Adam Jackson ajax at redhat.com
Wed Sep 17 08:07:22 PDT 2014


Pretty sure I'm guilty of adding this.  I think I was thinking of trying
to be compatible with some really old binary-only driver that I had
vague aspirations of reverse-engineering, but since I haven't gotten
around to it in the intervening decade...

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/xfree86/loader/loadmod.c | 46 +++++++++------------------------------------
 1 file changed, 9 insertions(+), 37 deletions(-)

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index f1f7c22..21ccb1b 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -584,7 +584,6 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
              const XF86ModReqInfo * req)
 {
     int vercode[4];
-    char verstr[4];
     long ver = data->xf86version;
     MessageType errtype;
 
@@ -592,42 +591,15 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
             data->modname ? data->modname : "UNKNOWN!",
             data->vendor ? data->vendor : "UNKNOWN!");
 
-    /* Check for the different scheme used in XFree86 4.0.x releases:
-     * ((((((((major << 7) | minor) << 7) | subminor) << 5) | beta) << 5) | alpha)
-     * Since it wasn't used in 4.1.0 or later, limit to versions in the 4.0.x
-     * range, which limits the overlap with the new version scheme to conflicts
-     * with 6.71.8.764 through 6.72.39.934.
-     */
-    if ((ver > (4 << 24)) && (ver < ((4 << 24) + (1 << 17)))) {
-        /* 4.0.x and earlier */
-        verstr[1] = verstr[3] = 0;
-        verstr[2] = (ver & 0x1f) ? (ver & 0x1f) + 'a' - 1 : 0;
-        ver >>= 5;
-        verstr[0] = (ver & 0x1f) ? (ver & 0x1f) + 'A' - 1 : 0;
-        ver >>= 5;
-        vercode[2] = ver & 0x7f;
-        ver >>= 7;
-        vercode[1] = ver & 0x7f;
-        ver >>= 7;
-        vercode[0] = ver;
-        xf86ErrorF("\tcompiled for %d.%d", vercode[0], vercode[1]);
-        if (vercode[2] != 0)
-            xf86ErrorF(".%d", vercode[2]);
-        xf86ErrorF("%s%s, module version = %d.%d.%d\n", verstr, verstr + 2,
-                   data->majorversion, data->minorversion, data->patchlevel);
-    }
-    else {
-        vercode[0] = ver / 10000000;
-        vercode[1] = (ver / 100000) % 100;
-        vercode[2] = (ver / 1000) % 100;
-        vercode[3] = ver % 1000;
-        xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1],
-                   vercode[2]);
-        if (vercode[3] != 0)
-            xf86ErrorF(".%d", vercode[3]);
-        xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion,
-                   data->minorversion, data->patchlevel);
-    }
+    vercode[0] = ver / 10000000;
+    vercode[1] = (ver / 100000) % 100;
+    vercode[2] = (ver / 1000) % 100;
+    vercode[3] = ver % 1000;
+    xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1], vercode[2]);
+    if (vercode[3] != 0)
+        xf86ErrorF(".%d", vercode[3]);
+    xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion,
+               data->minorversion, data->patchlevel);
 
     if (data->moduleclass)
         xf86ErrorFVerb(2, "\tModule class: %s\n", data->moduleclass);
-- 
1.9.3



More information about the xorg-devel mailing list