From 501dbf45cd85b0008e599637ad3ca76c044d39d5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 13 Nov 2013 14:17:51 +0000 Subject: [PATCH] sna: Eliminate a compiler warning for a shadowed variable We don't strictly need that local structure, so do without and keep the compiler quiet. sna_driver.c: In function 'fb_supports_depth': sna_driver.c:414:23: warning: declaration of 'close' shadows a global declaration [-Wshadow] Signed-off-by: Chris Wilson --- src/sna/sna_driver.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 00d90bfd..645746d2 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -411,7 +411,6 @@ static Bool fb_supports_depth(int fd, int depth) { struct drm_i915_gem_create create; struct drm_mode_fb_cmd fb; - struct drm_gem_close close; Bool ret; VG_CLEAR(create); @@ -431,9 +430,7 @@ static Bool fb_supports_depth(int fd, int depth) ret = drmIoctl(fd, DRM_IOCTL_MODE_ADDFB, &fb) == 0; drmModeRmFB(fd, fb.fb_id); - VG_CLEAR(close); - close.handle = create.handle; - (void)drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &close); + (void)drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &create.handle); return ret; }