[patch] drm/gma500: cleanup in psb_mode_operation_ioctl()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It looks like the "mode" test was changed at some point and but it
wasn't totally cleaned up.  I've removed the unneeded indent block and
the duplicative test for "if (mode)".

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 1199180667c9..411ed5b80d53 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -534,24 +534,22 @@ static int psb_mode_operation_ioctl(struct drm_device *dev, void *data,
 		}
 
 		/* drm_crtc_convert_umode(mode, umode); */
-		{
-			mode->clock = umode->clock;
-			mode->hdisplay = umode->hdisplay;
-			mode->hsync_start = umode->hsync_start;
-			mode->hsync_end = umode->hsync_end;
-			mode->htotal = umode->htotal;
-			mode->hskew = umode->hskew;
-			mode->vdisplay = umode->vdisplay;
-			mode->vsync_start = umode->vsync_start;
-			mode->vsync_end = umode->vsync_end;
-			mode->vtotal = umode->vtotal;
-			mode->vscan = umode->vscan;
-			mode->vrefresh = umode->vrefresh;
-			mode->flags = umode->flags;
-			mode->type = umode->type;
-			strncpy(mode->name, umode->name, DRM_DISPLAY_MODE_LEN);
-			mode->name[DRM_DISPLAY_MODE_LEN-1] = 0;
-		}
+		mode->clock = umode->clock;
+		mode->hdisplay = umode->hdisplay;
+		mode->hsync_start = umode->hsync_start;
+		mode->hsync_end = umode->hsync_end;
+		mode->htotal = umode->htotal;
+		mode->hskew = umode->hskew;
+		mode->vdisplay = umode->vdisplay;
+		mode->vsync_start = umode->vsync_start;
+		mode->vsync_end = umode->vsync_end;
+		mode->vtotal = umode->vtotal;
+		mode->vscan = umode->vscan;
+		mode->vrefresh = umode->vrefresh;
+		mode->flags = umode->flags;
+		mode->type = umode->type;
+		strncpy(mode->name, umode->name, DRM_DISPLAY_MODE_LEN);
+		mode->name[DRM_DISPLAY_MODE_LEN-1] = 0;
 
 		connector_funcs = (struct drm_connector_helper_funcs *)
 				   connector->helper_private;
@@ -562,8 +560,7 @@ static int psb_mode_operation_ioctl(struct drm_device *dev, void *data,
 		}
 
 		/*do some clean up work*/
-		if (mode)
-			drm_mode_destroy(dev, mode);
+		drm_mode_destroy(dev, mode);
 mode_op_out:
 		drm_modeset_unlock_all(dev);
 		return ret;
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux