diff mbox

[1/1,linux-next] drm: atmel-hlcdc: use swap() in atmel_hlcdc_plane_atomic_check()

Message ID 1433953918-23785-1-git-send-email-fabf@skynet.be (mailing list archive)
State New, archived
Headers show

Commit Message

Fabian Frederick June 10, 2015, 4:31 p.m. UTC
Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index be9fa82..abe3ba9 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -548,7 +548,6 @@  static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
 	unsigned int patched_crtc_h;
 	unsigned int patched_src_w;
 	unsigned int patched_src_h;
-	unsigned int tmp;
 	int x_offset = 0;
 	int y_offset = 0;
 	int hsub = 1;
@@ -586,12 +585,8 @@  static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
 	 * Swap width and size in case of 90 or 270 degrees rotation
 	 */
 	if (state->base.rotation & (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270))) {
-		tmp = state->crtc_w;
-		state->crtc_w = state->crtc_h;
-		state->crtc_h = tmp;
-		tmp = state->src_w;
-		state->src_w = state->src_h;
-		state->src_h = tmp;
+		swap(state->crtc_w, state->crtc_h);
+		swap(state->src_w, state->src_h);
 	}
 
 	if (state->crtc_x + state->crtc_w > mode->hdisplay)