Skip to contentSkip to conversation

qxl: silence uninitialized variable warning

PATCH In review Dan Carpenter 2 participants 2 messages Jul 11, 2016 – Jul 12, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 qxl: silence uninitialized variable warning

GCC doesn't complain about this but my static checker does. We're passing "drawable" before initializing it. It's not actually used so it's harmless and I just removed it.

drivers/gpu/drm/qxl/qxl_draw.c +1 -2
index 56e1d63..ffe8853 100644
@@ -37,7 +37,6 @@ static int alloc_clips(struct qxl_device *qdev,
  * the qxl_clip_rects. This is *not* the same as the memory allocated
  * on the device, it is offset to qxl_clip_rects.chunk.data */
 static struct qxl_rect *drawable_set_clipping(struct qxl_device *qdev,
-					      struct qxl_drawable *drawable,
 					      unsigned num_clips,
 					      struct qxl_bo *clips_bo)
 {
@@ -349,7 +350,7 @@ void qxl_draw_dirty_fb(struct qxl_device *qdev,
 	if (ret)
 		goto out_release_backoff;
 
-	rects = drawable_set_clipping(qdev, drawable, num_clips, clips_bo);
+	rects = drawable_set_clipping(qdev, num_clips, clips_bo);
 	if (!rects)
 		goto out_release_backoff;
 
#1 lore raw
Quoted 5 lines · Dan Carpenter

GCC doesn't complain about this but my static checker does. We're passing "drawable" before initializing it. It's not actually used so it's harmless and I just removed it.

Both of your qxl patches applied to drm-misc, thanks. -Daniel

Quoted 26 lines
drivers/gpu/drm/qxl/qxl_draw.c +1 -2
index 56e1d63..ffe8853 100644
@@ -37,7 +37,6 @@ static int alloc_clips(struct qxl_device *qdev,
  * the qxl_clip_rects. This is *not* the same as the memory allocated
  * on the device, it is offset to qxl_clip_rects.chunk.data */
 static struct qxl_rect *drawable_set_clipping(struct qxl_device *qdev,
-					      struct qxl_drawable *drawable,
 					      unsigned num_clips,
 					      struct qxl_bo *clips_bo)
 {
@@ -349,7 +350,7 @@ void qxl_draw_dirty_fb(struct qxl_device *qdev,
 	if (ret)
 		goto out_release_backoff;
 
-	rects = drawable_set_clipping(qdev, drawable, num_clips, clips_bo);
+	rects = drawable_set_clipping(qdev, num_clips, clips_bo);
 	if (!rects)
 		goto out_release_backoff;
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch