Re: [PATCH xserver 2/4] xfree86: remove unused path from the LoadModule API
On 18 April 2016 at 22:08, Adam Jackson wrote: > On Mon, 2016-04-18 at 21:44 +0100, Emil Velikov wrote: >> On 18 April 2016 at 21:43, Emil Velikov wrote: >> > >> > On 18 April 2016 at 20:50, Adam Jackson wrote: >> > > >> > > On Sun, 2016-04-17 at 21:07 +0100, Emil Velikov wrote: >> > > > >> > > > Similar to its little brothre - LoadSubModule. Currently all call sites >> > > > provide NULL anyway ;-) >> > > You can be more aggressive here, subdirlist and patternlist are also >> > > always NULL. And errmin is almost entirely pointless, I can only find >> > > one place that it disambiguates. >> > > >> > Sure I have patches for that as well. Here is my line of thought >> > >> > Step 1 - make LoadModule and LoadSubModule alike >> > Step 2 - nuke subdirlist, subdirlist, subdirlist and subdirlist, from >> > both APIs ;-) >> > >> Oops the list should be subdirlist, patternlist, options and modreq > > I'm not sure options can go? It seems to be the only reasonable way to > get configuration into, say, the vnc module. > Looking at it again... I've misread (and butchered) it. Yes it cannot go :-\ Emil ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 2/4] xfree86: remove unused path from the LoadModule API
On Mon, 2016-04-18 at 21:44 +0100, Emil Velikov wrote: > On 18 April 2016 at 21:43, Emil Velikov wrote: > > > > On 18 April 2016 at 20:50, Adam Jackson wrote: > > > > > > On Sun, 2016-04-17 at 21:07 +0100, Emil Velikov wrote: > > > > > > > > Similar to its little brothre - LoadSubModule. Currently all call sites > > > > provide NULL anyway ;-) > > > You can be more aggressive here, subdirlist and patternlist are also > > > always NULL. And errmin is almost entirely pointless, I can only find > > > one place that it disambiguates. > > > > > Sure I have patches for that as well. Here is my line of thought > > > > Step 1 - make LoadModule and LoadSubModule alike > > Step 2 - nuke subdirlist, subdirlist, subdirlist and subdirlist, from > > both APIs ;-) > > > Oops the list should be subdirlist, patternlist, options and modreq I'm not sure options can go? It seems to be the only reasonable way to get configuration into, say, the vnc module. - ajax ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 2/4] xfree86: remove unused path from the LoadModule API
On 18 April 2016 at 21:43, Emil Velikov wrote: > On 18 April 2016 at 20:50, Adam Jackson wrote: >> On Sun, 2016-04-17 at 21:07 +0100, Emil Velikov wrote: >>> Similar to its little brothre - LoadSubModule. Currently all call sites >>> provide NULL anyway ;-) >> >> You can be more aggressive here, subdirlist and patternlist are also >> always NULL. And errmin is almost entirely pointless, I can only find >> one place that it disambiguates. >> > Sure I have patches for that as well. Here is my line of thought > > Step 1 - make LoadModule and LoadSubModule alike > Step 2 - nuke subdirlist, subdirlist, subdirlist and subdirlist, from > both APIs ;-) > Oops the list should be subdirlist, patternlist, options and modreq -Emil ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 2/4] xfree86: remove unused path from the LoadModule API
On 18 April 2016 at 20:50, Adam Jackson wrote: > On Sun, 2016-04-17 at 21:07 +0100, Emil Velikov wrote: >> Similar to its little brothre - LoadSubModule. Currently all call sites >> provide NULL anyway ;-) > > You can be more aggressive here, subdirlist and patternlist are also > always NULL. And errmin is almost entirely pointless, I can only find > one place that it disambiguates. > Sure I have patches for that as well. Here is my line of thought Step 1 - make LoadModule and LoadSubModule alike Step 2 - nuke subdirlist, subdirlist, subdirlist and subdirlist, from both APIs ;-) -Emil ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 2/4] xfree86: remove unused path from the LoadModule API
On Sun, 2016-04-17 at 21:07 +0100, Emil Velikov wrote: > Similar to its little brothre - LoadSubModule. Currently all call sites > provide NULL anyway ;-) You can be more aggressive here, subdirlist and patternlist are also always NULL. And errmin is almost entirely pointless, I can only find one place that it disambiguates. - ajax ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 2/4] xfree86: remove unused path from the LoadModule API
On 04/17/2016 01:07 PM, Emil Velikov wrote: Similar to its little brothre - LoadSubModule. Currently all call sites provide NULL anyway ;-) Cc: Aaron Plattner Signed-off-by: Emil Velikov --- Aaron, are you guys using the argument in the closed source driver ? We don't call LoadModule at all. -Emil hw/xfree86/common/xf86Helper.c | 2 +- hw/xfree86/common/xf86Init.c| 2 +- hw/xfree86/doc/ddxDesign.xml| 8 +--- hw/xfree86/loader/loaderProcs.h | 2 +- hw/xfree86/loader/loadmod.c | 7 +++ 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 3b01a49..2c0f0d8 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1626,7 +1626,7 @@ xf86LoadOneModule(const char *name, void *opt) return NULL; } -mod = LoadModule(Name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin); +mod = LoadModule(Name, NULL, NULL, opt, NULL, &errmaj, &errmin); if (!mod) LoaderErrorMsg(NULL, Name, errmaj, errmin); free(Name); diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index de51497..9b88e29 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1571,7 +1571,7 @@ xf86LoadModules(const char **list, void **optlist) else opt = NULL; -if (!LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin)) { +if (!LoadModule(name, NULL, NULL, opt, NULL, &errmaj, &errmin)) { LoaderErrorMsg(NULL, name, errmaj, errmin); failed = TRUE; } diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml index a8e539c..7baf2cb 100644 --- a/hw/xfree86/doc/ddxDesign.xml +++ b/hw/xfree86/doc/ddxDesign.xml @@ -5222,7 +5222,7 @@ XFree86 common layer. -pointer LoadModule(const char *module, const char *path, +pointer LoadModule(const char *module, const char **subdirlist, const char **patternlist, pointer options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin); @@ -5238,12 +5238,6 @@ XFree86 common layer. This might change. The other parameters are: - - path - - An optional comma-separated list of module search paths. - When NULL, the default search path is used. - diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h index cfc4d80..8d7872f 100644 --- a/hw/xfree86/loader/loaderProcs.h +++ b/hw/xfree86/loader/loaderProcs.h @@ -74,7 +74,7 @@ void LoaderInit(void); ModuleDescPtr LoadDriver(const char *, const char *, int, void *, int *, int *); -ModuleDescPtr LoadModule(const char *, const char *, const char **, +ModuleDescPtr LoadModule(const char *, const char **, const char **, void *, const XF86ModReqInfo *, int *, int *); ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent); diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index 702d4e7..603ef65 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -747,7 +747,7 @@ LoadSubModule(void *_parent, const char *module, return NULL; } -submod = LoadModule(module, NULL, subdirlist, patternlist, options, +submod = LoadModule(module, subdirlist, patternlist, options, modreq, errmaj, errmin); if (submod && submod != (ModuleDescPtr) 1) { parent->child = AddSibling(parent->child, submod); @@ -817,7 +817,6 @@ static const char *compiled_in_modules[] = { * module The module name. Normally this is not a filename but the * module's "canonical name. A full pathname is, however, * also accepted. - * path A comma separated list of module directories. * subdirlist A NULL terminated list of subdirectories to search. When * NULL, the default "stdSubdirs" list is used. The default * list is also substituted for entries with value DEFAULT_LIST. @@ -849,7 +848,7 @@ static const char *compiled_in_modules[] = { * */ ModuleDescPtr -LoadModule(const char *module, const char *path, const char **subdirlist, +LoadModule(const char *module, const char **subdirlist, const char **patternlist, void *options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin) { @@ -905,7 +904,7 @@ LoadModule(const char *module, const char *path, const char **subdirlist, goto LoadModule_fail; } -pathlist = InitPathList(path); +pathlist = InitPathList(NULL); if (!pathlist) { /* This could be a malloc failure too */ if (errmaj) Reviewed-by: Aaron Plattner -- Aaron
[PATCH xserver 2/4] xfree86: remove unused path from the LoadModule API
Similar to its little brothre - LoadSubModule. Currently all call sites provide NULL anyway ;-) Cc: Aaron Plattner Signed-off-by: Emil Velikov --- Aaron, are you guys using the argument in the closed source driver ? -Emil hw/xfree86/common/xf86Helper.c | 2 +- hw/xfree86/common/xf86Init.c| 2 +- hw/xfree86/doc/ddxDesign.xml| 8 +--- hw/xfree86/loader/loaderProcs.h | 2 +- hw/xfree86/loader/loadmod.c | 7 +++ 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 3b01a49..2c0f0d8 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1626,7 +1626,7 @@ xf86LoadOneModule(const char *name, void *opt) return NULL; } -mod = LoadModule(Name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin); +mod = LoadModule(Name, NULL, NULL, opt, NULL, &errmaj, &errmin); if (!mod) LoaderErrorMsg(NULL, Name, errmaj, errmin); free(Name); diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index de51497..9b88e29 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1571,7 +1571,7 @@ xf86LoadModules(const char **list, void **optlist) else opt = NULL; -if (!LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin)) { +if (!LoadModule(name, NULL, NULL, opt, NULL, &errmaj, &errmin)) { LoaderErrorMsg(NULL, name, errmaj, errmin); failed = TRUE; } diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml index a8e539c..7baf2cb 100644 --- a/hw/xfree86/doc/ddxDesign.xml +++ b/hw/xfree86/doc/ddxDesign.xml @@ -5222,7 +5222,7 @@ XFree86 common layer. -pointer LoadModule(const char *module, const char *path, +pointer LoadModule(const char *module, const char **subdirlist, const char **patternlist, pointer options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin); @@ -5238,12 +5238,6 @@ XFree86 common layer. This might change. The other parameters are: - - path - - An optional comma-separated list of module search paths. - When NULL, the default search path is used. - diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h index cfc4d80..8d7872f 100644 --- a/hw/xfree86/loader/loaderProcs.h +++ b/hw/xfree86/loader/loaderProcs.h @@ -74,7 +74,7 @@ void LoaderInit(void); ModuleDescPtr LoadDriver(const char *, const char *, int, void *, int *, int *); -ModuleDescPtr LoadModule(const char *, const char *, const char **, +ModuleDescPtr LoadModule(const char *, const char **, const char **, void *, const XF86ModReqInfo *, int *, int *); ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent); diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index 702d4e7..603ef65 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -747,7 +747,7 @@ LoadSubModule(void *_parent, const char *module, return NULL; } -submod = LoadModule(module, NULL, subdirlist, patternlist, options, +submod = LoadModule(module, subdirlist, patternlist, options, modreq, errmaj, errmin); if (submod && submod != (ModuleDescPtr) 1) { parent->child = AddSibling(parent->child, submod); @@ -817,7 +817,6 @@ static const char *compiled_in_modules[] = { * module The module name. Normally this is not a filename but the * module's "canonical name. A full pathname is, however, * also accepted. - * path A comma separated list of module directories. * subdirlist A NULL terminated list of subdirectories to search. When * NULL, the default "stdSubdirs" list is used. The default * list is also substituted for entries with value DEFAULT_LIST. @@ -849,7 +848,7 @@ static const char *compiled_in_modules[] = { * */ ModuleDescPtr -LoadModule(const char *module, const char *path, const char **subdirlist, +LoadModule(const char *module, const char **subdirlist, const char **patternlist, void *options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin) { @@ -905,7 +904,7 @@ LoadModule(const char *module, const char *path, const char **subdirlist, goto LoadModule_fail; } -pathlist = InitPathList(path); +pathlist = InitPathList(NULL); if (!pathlist) { /* This could be a malloc failure too */ if (errmaj) -- 2.8.0 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https:/