[PATCH xserver 01/11] xfree86: Fix set but not used warnings in lnx_platform

Daniel Martin consume.noise at gmail.com
Tue Nov 7 09:38:32 UTC 2017


../hw/xfree86/os-support/linux/lnx_platform.c: In function ‘get_drm_info’:
../hw/xfree86/os-support/linux/lnx_platform.c:29:16: warning: variable ‘minor’ set but not used [-Wunused-but-set-variable]
     int major, minor, fd;
                ^~~~~
../hw/xfree86/os-support/linux/lnx_platform.c:29:9: warning: variable ‘major’ set but not used [-Wunused-but-set-variable]
     int major, minor, fd;
         ^~~~~

Signed-off-by: Daniel Martin <consume.noise at gmail.com>
---
 hw/xfree86/os-support/linux/lnx_platform.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c
index 1d145b362..11af52c46 100644
--- a/hw/xfree86/os-support/linux/lnx_platform.c
+++ b/hw/xfree86/os-support/linux/lnx_platform.c
@@ -26,19 +26,16 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
     drmSetVersion sv;
     drmVersionPtr v;
     char *buf;
-    int major, minor, fd;
+    int fd;
     int err = 0;
     Bool paused, server_fd = FALSE;
 
-    major = attribs->major;
-    minor = attribs->minor;
-
-    fd = systemd_logind_take_fd(major, minor, path, &paused);
+    fd = systemd_logind_take_fd(attribs->major, attribs->minor, path, &paused);
     if (fd != -1) {
         if (paused) {
             LogMessage(X_ERROR,
                     "Error systemd-logind returned paused fd for drm node\n");
-            systemd_logind_release_fd(major, minor, -1);
+            systemd_logind_release_fd(attribs->major, attribs->minor, -1);
             return FALSE;
         }
         attribs->fd = fd;
-- 
2.13.6



More information about the xorg-devel mailing list