xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 10 17:44:36 UTC 2024


 hw/xfree86/common/xf86Helper.c |    4 ++--
 hw/xfree86/loader/loader.c     |   25 ++++++++++++-------------
 hw/xfree86/loader/loadmod.c    |   18 +++++++++---------
 hw/xwin/winerror.c             |    2 +-
 include/os.h                   |    6 ------
 os/log.c                       |   20 ++------------------
 6 files changed, 26 insertions(+), 49 deletions(-)

New commits:
commit e5b5b302d3a1170cefce44e3f12219eedfbd96ea
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Mon Sep 9 16:14:33 2024 +0200

    os: replace LogVWrite() by LogVMessageVerb()
    
    It's just a wrapper around LogVMessageVerb() and no external module
    using it, so can easily be optimized-away.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1683>

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 1e7a375c8..105a93b2b 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1123,7 +1123,7 @@ xf86ErrorFVerb(int verb, const char *format, ...)
 
     va_start(ap, format);
     if (xf86Verbose >= verb || xf86LogVerbose >= verb)
-        LogVWrite(verb, format, ap);
+        LogVMessageVerb(X_NONE, verb, format, ap);
     va_end(ap);
 }
 
@@ -1135,7 +1135,7 @@ xf86ErrorF(const char *format, ...)
 
     va_start(ap, format);
     if (xf86Verbose >= 1 || xf86LogVerbose >= 1)
-        LogVWrite(1, format, ap);
+        LogVMessageVerb(X_NONE, 1, format, ap);
     va_end(ap);
 }
 
diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
index b9cffd8d7..bdf03f053 100644
--- a/hw/xwin/winerror.c
+++ b/hw/xwin/winerror.c
@@ -50,7 +50,7 @@ OsVendorVErrorF(const char *pszFormat, va_list va_args)
     pthread_mutex_lock(&s_pmPrinting);
 
     /* Print the error message to a log file, could be stderr */
-    LogVWrite(0, pszFormat, va_args);
+    LogVMessageVerb(X_NONE, 0, pszFormat, va_args);
 
     /* Unlock the printing mutex */
     pthread_mutex_unlock(&s_pmPrinting);
diff --git a/include/os.h b/include/os.h
index 4892affd6..fa41d6698 100644
--- a/include/os.h
+++ b/include/os.h
@@ -355,9 +355,6 @@ LogClose(enum ExitCode error);
 extern _X_EXPORT Bool
 LogSetParameter(LogParameter param, int value);
 extern _X_EXPORT void
-LogVWrite(int verb, const char *f, va_list args)
-_X_ATTRIBUTE_PRINTF(2, 0);
-extern _X_EXPORT void
 LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
 _X_ATTRIBUTE_PRINTF(3, 0);
 extern _X_EXPORT void
diff --git a/os/log.c b/os/log.c
index 9dbe83c8d..92334e897 100644
--- a/os/log.c
+++ b/os/log.c
@@ -629,12 +629,6 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line)
     (void) ret;
 }
 
-void
-LogVWrite(int verb, const char *f, va_list args)
-{
-    return LogVMessageVerb(X_NONE, verb, f, args);
-}
-
 /* Returns the Message Type string to prepend to a logging message, or NULL
  * if the message will be dropped due to insufficient verbosity. */
 static const char *
@@ -1003,7 +997,7 @@ VErrorF(const char *f, va_list args)
     if (OsVendorVErrorFProc)
         OsVendorVErrorFProc(f, args);
     else
-        LogVWrite(-1, f, args);
+        LogVMessageVerb(X_NONE, -1, f, args);
 }
 
 void
commit c26023a0099e696728946b876f320cf4040cde6c
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Mon Sep 9 15:41:06 2024 +0200

    os: replace LogWrite() by LogMessageVerb()
    
    It's nothing but a wrapper, doing the same as LogMessageVerb(X_NONE, ...),
    and no external module / driver needs it, so can be easily optimized away.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1683>

diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index 2580e93d9..4696b639d 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -75,19 +75,18 @@ LoaderInit(void)
     LogMessageVerb(X_INFO, 2, "Loader magic: %p\n", (void *) xorg_symbols);
 #endif
     LogMessageVerb(X_INFO, 2, "Module ABI versions:\n");
-    LogWrite(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC,
-             GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion),
-             GET_ABI_MINOR(LoaderVersionInfo.ansicVersion));
-    LogWrite(2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV,
-             GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion),
-             GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion));
-    LogWrite(2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT,
-             GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion),
-             GET_ABI_MINOR(LoaderVersionInfo.xinputVersion));
-    LogWrite(2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION,
-             GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion),
-             GET_ABI_MINOR(LoaderVersionInfo.extensionVersion));
-
+    LogMessageVerb(X_NONE, 2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC,
+                   GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion),
+                   GET_ABI_MINOR(LoaderVersionInfo.ansicVersion));
+    LogMessageVerb(X_NONE, 2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV,
+                   GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion),
+                   GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion));
+    LogMessageVerb(X_NONE, 2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT,
+                   GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion),
+                   GET_ABI_MINOR(LoaderVersionInfo.xinputVersion));
+    LogMessageVerb(X_NONE, 2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION,
+                   GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion),
+                   GET_ABI_MINOR(LoaderVersionInfo.extensionVersion));
 }
 
 /* Public Interface to the loader. */
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index fd7afa884..cca11028c 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -438,14 +438,14 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
     vercode[1] = (ver / 100000) % 100;
     vercode[2] = (ver / 1000) % 100;
     vercode[3] = ver % 1000;
-    LogWrite(1, "\tcompiled for %d.%d.%d", vercode[0], vercode[1], vercode[2]);
+    LogMessageVerb(X_NONE, 1, "\tcompiled for %d.%d.%d", vercode[0], vercode[1], vercode[2]);
     if (vercode[3] != 0)
-        LogWrite(1, ".%d", vercode[3]);
-    LogWrite(1, ", module version = %d.%d.%d\n", data->majorversion,
-             data->minorversion, data->patchlevel);
+        LogMessageVerb(X_NONE, 1, ".%d", vercode[3]);
+    LogMessageVerb(X_NONE, 1, ", module version = %d.%d.%d\n", data->majorversion,
+                   data->minorversion, data->patchlevel);
 
     if (data->moduleclass)
-        LogWrite(2, "\tModule class: %s\n", data->moduleclass);
+        LogMessageVerb(X_NONE, 2, "\tModule class: %s\n", data->moduleclass);
 
     ver = -1;
     if (data->abiclass) {
@@ -463,8 +463,8 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
 
         abimaj = GET_ABI_MAJOR(data->abiversion);
         abimin = GET_ABI_MINOR(data->abiversion);
-        LogWrite(2, "\tABI class: %s, version %d.%d\n",
-                 data->abiclass, abimaj, abimin);
+        LogMessageVerb(X_NONE, 2, "\tABI class: %s, version %d.%d\n",
+                       data->abiclass, abimaj, abimin);
         if (ver != -1) {
             vermaj = GET_ABI_MAJOR(ver);
             vermin = GET_ABI_MINOR(ver);
@@ -686,14 +686,14 @@ LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
     name = LoaderGetCanonicalName(module, patterns);
     noncanonical = (name && strcmp(module, name) != 0);
     if (noncanonical) {
-        LogWrite(3, " (%s)\n", name);
+        LogMessageVerb(X_NONE, 3, " (%s)\n", name);
         LogMessageVerb(X_WARNING, 1,
                        "LoadModule: given non-canonical module name \"%s\"\n",
                        module);
         m = name;
     }
     else {
-        LogWrite(3, "\n");
+        LogMessageVerb(X_NONE, 3, "\n");
         m = (char *) module;
     }
 
diff --git a/include/os.h b/include/os.h
index 361c4552f..4892affd6 100644
--- a/include/os.h
+++ b/include/os.h
@@ -358,9 +358,6 @@ extern _X_EXPORT void
 LogVWrite(int verb, const char *f, va_list args)
 _X_ATTRIBUTE_PRINTF(2, 0);
 extern _X_EXPORT void
-LogWrite(int verb, const char *f, ...)
-_X_ATTRIBUTE_PRINTF(2, 3);
-extern _X_EXPORT void
 LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
 _X_ATTRIBUTE_PRINTF(3, 0);
 extern _X_EXPORT void
diff --git a/os/log.c b/os/log.c
index e258cc62f..9dbe83c8d 100644
--- a/os/log.c
+++ b/os/log.c
@@ -635,16 +635,6 @@ LogVWrite(int verb, const char *f, va_list args)
     return LogVMessageVerb(X_NONE, verb, f, args);
 }
 
-void
-LogWrite(int verb, const char *f, ...)
-{
-    va_list args;
-
-    va_start(args, f);
-    LogVWrite(verb, f, args);
-    va_end(args);
-}
-
 /* Returns the Message Type string to prepend to a logging message, or NULL
  * if the message will be dropped due to insufficient verbosity. */
 static const char *
@@ -1046,7 +1036,7 @@ void
 LogPrintMarkers(void)
 {
     /* Show what the message marker symbols mean. */
-    LogWrite(0, "Markers: ");
+    LogMessageVerb(X_NONE, 0, "Markers: ");
     LogMessageVerb(X_PROBED, 0, "probed, ");
     LogMessageVerb(X_CONFIG, 0, "from config file, ");
     LogMessageVerb(X_DEFAULT, 0, "default setting,\n\t");


More information about the xorg-commit mailing list