[PATCH xserver 2/6] xfree86: Fix set but not used warnings in lnx_platform
Daniel Martin
consume.noise at gmail.com
Mon Nov 20 09:47:39 UTC 2017
Those warnings are generated, when building without systemd support:
../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;
^~~~~
In this case the functions are macros, which don't use theese arguments.
v2: Add comments, why the warnings appear. Suggested by Emil Velikov
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
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