sna: Eliminate a compiler warning for a shadowed variable
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 13 Nov 2013 14:17:51 +0000 (14:17 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 14 Nov 2013 10:42:07 +0000 (10:42 +0000)
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 <chris@chris-wilson.co.uk>
src/sna/sna_driver.c

index 00d90bf..645746d 100644 (file)
@@ -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;
 }