From bd4198b01f2baf2284e61ea7ebf4600f554800e9 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 18 Jul 2014 11:19:01 -0700 Subject: [PATCH] xfree86: Avoid compiler warning for unused vars without systemd When systemd isn't being used, systemd_logind_release_fd is defined as an empty macro, leaving the arguments unused. Fix the compiler warnings by simply removing the local variables and referencing the structure within the macro call. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt --- hw/xfree86/common/xf86platformBus.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index 22e4603e6..946039940 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -348,7 +348,7 @@ static Bool doPlatformProbe(struct xf86_platform_device *dev, DriverPtr drvp, GDevPtr gdev, int flags, intptr_t match_data) { Bool foundScreen = FALSE; - int entity, fd, major, minor; + int entity; if (gdev && gdev->screen == 0 && !xf86_check_platform_slot(dev)) return FALSE; @@ -374,10 +374,7 @@ static Bool doPlatformProbe(struct xf86_platform_device *dev, DriverPtr drvp, if (entity != -1) { if ((dev->flags & XF86_PDEV_SERVER_FD) && (!drvp->driverFunc || !drvp->driverFunc(NULL, SUPPORTS_SERVER_FDS, NULL))) { - fd = dev->attribs->fd; - major = dev->attribs->major; - minor = dev->attribs->minor; - systemd_logind_release_fd(major, minor, fd); + systemd_logind_release_fd(dev->attribs->major, dev->attribs->minor, dev->attribs->fd); dev->attribs->fd = -1; dev->flags &= ~XF86_PDEV_SERVER_FD; }