[PATCH xserver 11/19] xfree86: Remove DriverRec1 compat struct

Adam Jackson ajax at redhat.com
Mon Jan 23 19:32:25 UTC 2017


The idea here is that the driver might have once been old enough to not
have the driverFunc slot in DriverRec, with the module ABI not having
changed when it was added. That was ages ago, and drivers always declare
themselves with DriverRec not DriverRec1, so uninitialized slots will
simply be zero.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/xfree86/common/xf86Helper.c |  9 +--------
 hw/xfree86/common/xf86str.h    | 10 ----------
 2 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index f48af75..b464864 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -79,14 +79,7 @@ xf86AddDriver(DriverPtr driver, void *module, int flags)
     xf86DriverList = xnfreallocarray(xf86DriverList,
                                      xf86NumDrivers, sizeof(DriverPtr));
     xf86DriverList[xf86NumDrivers - 1] = xnfalloc(sizeof(DriverRec));
-    if (flags & HaveDriverFuncs)
-        *xf86DriverList[xf86NumDrivers - 1] = *driver;
-    else {
-        (void) memset(xf86DriverList[xf86NumDrivers - 1], 0, sizeof(DriverRec));
-        (void) memcpy(xf86DriverList[xf86NumDrivers - 1], driver,
-                      sizeof(DriverRec1));
-
-    }
+    *xf86DriverList[xf86NumDrivers - 1] = *driver;
     xf86DriverList[xf86NumDrivers - 1]->module = module;
     xf86DriverList[xf86NumDrivers - 1]->refCount = 0;
 }
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index bfcb75e..74c65ba 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -209,16 +209,6 @@ typedef CARD32 xorgHWFlags;
  */
 struct _DriverRec;
 
-typedef struct {
-    int driverVersion;
-    const char *driverName;
-    void (*Identify) (int flags);
-    Bool (*Probe) (struct _DriverRec * drv, int flags);
-    const OptionInfoRec *(*AvailableOptions) (int chipid, int bustype);
-    void *module;
-    int refCount;
-} DriverRec1;
-
 struct _SymTabRec;
 struct _PciChipsets;
 
-- 
2.9.3



More information about the xorg-devel mailing list