@@ -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)
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(-)