xfree86: common: unexport UnloadModule() and UnloadSubModule()

Not used by any driver/module, so no need to keep it exported.
Also making them type-safe.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1722>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-10-16 15:58:58 +02:00 committed by Marge Bot
parent b0452ecff4
commit 00f69564c5
6 changed files with 28 additions and 8 deletions

View File

@ -61,6 +61,7 @@
#include "xf86InPriv.h"
#include "xf86Config.h"
#include "mivalidate.h"
#include "xf86Module_priv.h"
/* For xf86GetClocks */
#if defined(CSRG_BASED) || defined(__GNU__)

View File

@ -66,6 +66,7 @@
#include "systemd-logind.h"
#include "loaderProcs.h"
#include "xf86Module_priv.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86Config.h"

View File

@ -151,8 +151,6 @@ typedef struct {
extern _X_EXPORT void *LoadSubModule(void *, const char *, const char **,
const char **, void *,
const XF86ModReqInfo *, int *, int *);
extern _X_EXPORT void UnloadSubModule(void *);
extern _X_EXPORT void UnloadModule(void *);
extern _X_EXPORT void *LoaderSymbol(const char *);
extern _X_EXPORT void *LoaderSymbolFromModule(void *, const char *);
extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int);

View File

@ -0,0 +1,22 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XORG_XF86MODULE_PRIV_H
#define _XORG_XF86MODULE_PRIV_H
/*
* unload a previously loaded module
*
* @param mod the module to unload
*/
void UnloadModule(ModuleDescPtr mod);
/*
* unload a previously loaded sun-module
*
* @param mod the sub-module to unload
*/
void UnloadSubModule(ModuleDescPtr mod);
#endif /* _XORG_XF86MODULE_PRIV_H */

View File

@ -76,6 +76,7 @@
#include "eventstr.h"
#include "inpututils.h"
#include "optionstr.h"
#include "xf86Module_priv.h"
#ifdef HAVE_FNMATCH_H
#include <fnmatch.h>

View File

@ -55,6 +55,7 @@
#include "loaderProcs.h"
#include "xf86Module.h"
#include "loader.h"
#include "xf86Module_priv.h"
#include <sys/stat.h>
#include <sys/types.h>
@ -840,10 +841,8 @@ LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
}
void
UnloadModule(void *_mod)
UnloadModule(ModuleDescPtr mod)
{
ModuleDescPtr mod = _mod;
if (mod == (ModuleDescPtr) 1)
return;
@ -873,10 +872,8 @@ UnloadModule(void *_mod)
}
void
UnloadSubModule(void *_mod)
UnloadSubModule(ModuleDescPtr mod)
{
ModuleDescPtr mod = (ModuleDescPtr) _mod;
/* Some drivers are calling us on built-in submodules, ignore them */
if (mod == (ModuleDescPtr) 1)
return;