xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 30 18:51:49 UTC 2020


 hw/xfree86/os-support/linux/lnx_apm.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 9890e91265cb58c0cddc4de3c8845d18ae6e5a77
Author: Tobias Stoeckmann <tobias at stoeckmann.org>
Date:   Sun Apr 19 15:29:43 2020 +0200

    hw/xfree86: Support ACPI without APM.
    
    On systems with ACPI but disabled APM (e.g. --disable-linux-apm)
    the code does not compile due to preprocessor directives.
    
    If APM is disabled, the final return statement is considered to
    be part of ACPI's last if-statement, leading to a function which
    has no final return statement at all.
    
    I have refactored the code so ACPI and APM are independent of each
    other.
    
    Signed-off-by: Tobias Stoeckmann <tobias at stoeckmann.org>

diff --git a/hw/xfree86/os-support/linux/lnx_apm.c b/hw/xfree86/os-support/linux/lnx_apm.c
index 29c363360..b928febf6 100644
--- a/hw/xfree86/os-support/linux/lnx_apm.c
+++ b/hw/xfree86/os-support/linux/lnx_apm.c
@@ -138,13 +138,14 @@ xf86OSPMOpen(void)
 #ifdef HAVE_ACPI
     /* Favour ACPI over APM, but only when enabled */
 
-    if (!xf86acpiDisableFlag)
+    if (!xf86acpiDisableFlag) {
         ret = lnxACPIOpen();
-
-    if (!ret)
+        if (ret)
+            return ret;
+    }
 #endif
 #ifdef HAVE_APM
-        ret = lnxAPMOpen();
+    ret = lnxAPMOpen();
 #endif
 
     return ret;


More information about the xorg-commit mailing list