From patchwork Wed Jun 10 16:31:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 6585531 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E56D9C0020 for ; Thu, 11 Jun 2015 00:32:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96BBE2061E for ; Thu, 11 Jun 2015 00:32:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 24B632061A for ; Thu, 11 Jun 2015 00:32:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E77A7A12E; Wed, 10 Jun 2015 17:32:32 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailrelay110.isp.belgacom.be (mailrelay110.isp.belgacom.be [195.238.20.137]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CEB66E2D7 for ; Wed, 10 Jun 2015 09:32:06 -0700 (PDT) X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=eWtaKQUTUbzTvYESxgzcVvJXO5dQmjbJ/tTWSlQWV0k= c=1 sm=2 a=A9L2yrXZp98jHO6gcRoA:9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C5HgAlZXhV/5QztFtcgxABgTKrcwUBAQEBAQEFAYEEAZJchgmBOj0QAQEBAQEBAYEKQQOEDC8jgRo3iDIB0hGGGYowHYQXBZ8AjUaKNSRiZgELZ4E/PDGCRwEBAQ Received: from 148.51-180-91.adsl-dyn.isp.belgacom.be (HELO localhost.home.) ([91.180.51.148]) by relay.skynet.be with ESMTP; 10 Jun 2015 18:32:05 +0200 From: Fabian Frederick To: linux-kernel@vger.kernel.org Subject: [PATCH 1/1 linux-next] drm: atmel-hlcdc: use swap() in atmel_hlcdc_plane_atomic_check() Date: Wed, 10 Jun 2015 18:31:57 +0200 Message-Id: <1433953918-23785-1-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 2.4.2 X-Mailman-Approved-At: Wed, 10 Jun 2015 17:32:28 -0700 Cc: Fabian Frederick , Julia Lawall , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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)