[PATCH xserver 1/3] modesetting: Fix warning of unused variable if not GLAMOR_HAS_GBM

Daniel Martin consume.noise at gmail.com
Fri Oct 20 08:05:33 UTC 2017


../hw/xfree86/drivers/modesetting/driver.c: In function ‘redisplay_dirty’:
../hw/xfree86/drivers/modesetting/driver.c:586:20: warning: unused variable ‘ms’ [-Wunused-variable]
     modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen));

Move the variable ms into #ifdef GLAMOR_HAS_GBM, where it is used.

Signed-off-by: Daniel Martin <consume.noise at gmail.com>
---
 hw/xfree86/drivers/modesetting/driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 9afb344c8..91d850427 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -585,7 +585,6 @@ dispatch_slave_dirty(ScreenPtr pScreen)
 static void
 redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty, int *timeout)
 {
-    modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen));
     RegionRec pixregion;
 
     PixmapRegionInit(&pixregion, dirty->slave_dst);
@@ -594,6 +593,7 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty, int *timeout)
 
     if (!screen->isGPU) {
 #ifdef GLAMOR_HAS_GBM
+        modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen));
         /*
          * When copying from the master framebuffer to the shared pixmap,
          * we must ensure the copy is complete before the slave starts a
-- 
2.13.6



More information about the xorg-devel mailing list