From b37462b4da7c389ec7bbcfd800e5f88bded79330 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Sun, 2 May 2010 19:53:37 +0300 Subject: [PATCH] xfree86: remove unused xf86AccessInit() The function was only initializing the boolean xf86ResAccessEnter, which couldn't get any other value in the life of the server. The only possible, though suspicious, code was in xf86AccessLeave(), which could be triggered if AbortDDX is called before xf86AccessInit(). Even so, such change is safety because no driver would have configured any entity leave procedure at this point. Signed-off-by: Tiago Vignatti Reviewed-by: Adam Jackson --- hw/xfree86/common/xf86Bus.c | 19 ++----------------- hw/xfree86/common/xf86Init.c | 4 +--- hw/xfree86/common/xf86Priv.h | 1 - 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 39e531a59..7d4853ab9 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -58,8 +58,6 @@ static int xf86EntityPrivateCount = 0; BusRec primaryBus = { BUS_NONE, { 0 } }; -static Bool xf86ResAccessEnter = FALSE; - static Bool doFramebufferMode = FALSE; /* @@ -385,16 +383,6 @@ xf86GetDevFromEntity(int entityIndex, int instance) return xf86Entities[entityIndex]->devices[i]; } -/* - * xf86AccessInit() - set up everything needed for access control - * called only once on first server generation. - */ -void -xf86AccessInit(void) -{ - xf86ResAccessEnter = TRUE; -} - /* * xf86AccessEnter() -- gets called to save the text mode VGA IO * resources when reentering the server after a VT switch. @@ -402,8 +390,7 @@ xf86AccessInit(void) void xf86AccessEnter(void) { - if (xf86ResAccessEnter) - return; + return; /* * on enter we simply disable routing of special resources @@ -411,7 +398,6 @@ xf86AccessEnter(void) */ EntityEnter(); xf86EnterServerState(SETUP); - xf86ResAccessEnter = TRUE; } /* @@ -426,8 +412,7 @@ xf86AccessEnter(void) void xf86AccessLeave(void) { - if (!xf86ResAccessEnter) - return; + return; EntityLeave(); } diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 39d229b9a..80877e7f8 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -700,10 +700,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) /* * Locate bus slot that had register IO enabled at server startup */ - if (xorgHWAccess) { - xf86AccessInit(); + if (xorgHWAccess) xf86FindPrimaryDevice(); - } /* * Now call each of the Probe functions. Each successful probe will * result in an extra entry added to the xf86Screens[] list for each diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index 0612c9c4e..6faf4d5bd 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -112,7 +112,6 @@ extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable; /* xf86Bus.c */ extern _X_EXPORT void xf86BusProbe(void); -extern _X_EXPORT void xf86AccessInit(void); extern _X_EXPORT void xf86AccessEnter(void); extern _X_EXPORT void xf86AccessLeave(void); extern _X_EXPORT void xf86EntityInit(void);