From 5c577da5f3a65c68d2ee12e4afca8f20c3e8ccf4 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 14 Jul 2016 15:42:18 -0400 Subject: [PATCH] xfree86: Remove DriverRec1 compat struct 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. Reviewed-by: Emil Velikov Reviewed-by: Eric Anholt Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson --- 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 f48af75dd..b4648641c 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 bfcb75ec0..74c65baa8 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;