Remove some braindamage from ModuleDesc.

Yay dead code elimination.
This commit is contained in:
Adam Jackson 2008-02-01 17:33:48 +11:00
parent e91ff09568
commit f750ce53ac
3 changed files with 0 additions and 28 deletions

View File

@ -1,4 +1,3 @@
/*
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
*

View File

@ -62,17 +62,11 @@ typedef struct module_desc {
struct module_desc *child;
struct module_desc *sib;
struct module_desc *parent;
struct module_desc *demand_next;
char *name;
char *filename;
char *identifier;
XID client_id;
int in_use;
int handle;
ModuleSetupProc SetupProc;
ModuleTearDownProc TearDownProc;
void *TearDownData; /* returned from SetupProc */
const char *path;
const XF86ModuleVersionInfo *VersionInfo;
} ModuleDesc, *ModuleDescPtr;

View File

@ -786,12 +786,7 @@ NewModuleDesc(const char *name)
mdp->child = NULL;
mdp->sib = NULL;
mdp->parent = NULL;
mdp->demand_next = NULL;
mdp->name = xstrdup(name);
mdp->filename = NULL;
mdp->identifier = NULL;
mdp->client_id = 0;
mdp->in_use = 0;
mdp->handle = -1;
mdp->SetupProc = NULL;
mdp->TearDownProc = NULL;
@ -816,15 +811,10 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
if (LoaderHandleOpen(mod->handle) == -1)
return NULL;
ret->filename = xstrdup(mod->filename);
ret->identifier = mod->identifier;
ret->client_id = mod->client_id;
ret->in_use = mod->in_use;
ret->handle = mod->handle;
ret->SetupProc = mod->SetupProc;
ret->TearDownProc = mod->TearDownProc;
ret->TearDownData = NULL;
ret->path = mod->path;
ret->child = DuplicateModule(mod->child, ret);
ret->sib = DuplicateModule(mod->sib, parent);
ret->parent = parent;
@ -943,8 +933,6 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
if (ret->handle < 0)
goto LoadModule_fail;
ret->filename = xstrdup(found);
/* drop any explicit suffix from the module name */
p = strchr(name, '.');
if (p)
@ -998,7 +986,6 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
ret->SetupProc = setup;
if (teardown)
ret->TearDownProc = teardown;
ret->path = path;
ret->VersionInfo = vers;
} else {
/* No initdata is OK for external modules */
@ -1120,7 +1107,6 @@ UnloadModuleOrDriver(ModuleDescPtr mod)
if (mod->sib)
UnloadModuleOrDriver(mod->sib);
TestFree(mod->name);
TestFree(mod->filename);
xfree(mod);
#ifdef __alpha__
istream_mem_barrier();
@ -1145,7 +1131,6 @@ UnloadSubModule(ModuleDescPtr mod)
UnloadModuleOrDriver(mod->child);
TestFree(mod->name);
TestFree(mod->filename);
xfree(mod);
}
@ -1156,12 +1141,6 @@ FreeModuleDesc(ModuleDescPtr head)
if (head == (ModuleDescPtr) 1)
return;
/*
* only free it if it's not marked as in use. In use means that it may
* be unloaded someday, and UnloadModule will free it
*/
if (head->in_use)
return;
if (head->child)
FreeModuleDesc(head->child);
sibs = head;