[PATCH 01/10] xfree86: remove unused xf86AccessInit()

Tiago Vignatti tiago.vignatti at nokia.com
Sun May 2 13:07:37 PDT 2010


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 <tiago.vignatti at nokia.com>
---
 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 9d243c1..4213d99 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;
 
 /*
@@ -386,24 +384,13 @@ xf86GetDevFromEntity(int entityIndex, int instance)
 }
 
 /*
- * 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.
  */
 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 55d7a62..914b433 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 0612c9c..6faf4d5 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);
-- 
1.6.0.4



More information about the xorg-devel mailing list