Received: by 10.223.164.202 with SMTP id h10csp775762wrb; Fri, 10 Nov 2017 14:56:23 -0800 (PST) X-Google-Smtp-Source: AGs4zMbwLrAIxhArQR6sqFiytwFsjFNz181V5CYfpSetUfdWZu8CDUl+p7PBtNToNP6TetJnBxQa X-Received: by 10.99.142.73 with SMTP id k70mr1823301pge.426.1510354583022; Fri, 10 Nov 2017 14:56:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510354582; cv=none; d=google.com; s=arc-20160816; b=FgoWjrXCqjzlI5KorpUyI46Bxx6FPvTzXh+6Z/XTiMpvdGMiC2swJ7MEbo1XEju0ty zYePF19Y5BrK3wKscAUZNK8t3c37JbqLfWyS+ALe5FW0CEbQVfSpLklY1KkDfIxaF3Ga KvGoIFiOvGs7YNj9NS5SWYg+UCp/7skujSCA7X7s8lk49bIvUf2BPytwfFMt7LxE/oU/ ni4hM0D4PajH1iwbc3EzzQ9mEAY1qJrspt/Unktmj+ZZ2Nl7c93qhCddhkUCIZe+eKq9 GDWiBhvjMQ+SVn3tuxih9f89RTgFmMFAd1YfS9EtSzD6TMvS/tkrjbdd5uzZaZdaQA7o XkaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=vwYNWbyF3aFTKrLA96Ix81xCdPTiqBEroVef/LP1SMw=; b=D5rPV8DzrojQR4gNtpuzqeg2kVj3yizs1adUbq/bBp0btqeF4xO4hFTqO7ub1dGxIt /JXOM1aoDc87GRE2ciKVuSSpLD7w84HBGSym6cJECnUIhg4g+YkHvVUGCUeD8fVsZO+u +rfsO1170+LbttVSNuQUamzWV5yhFr9l72coq3YRXD/TyqMN1+cJACa6kyNSZ0DBS5eM GsSwkI24SEfOKu56I2ExVqFkigtDwkYCR/a9Sgaee9qfCRGJ+0rJB9ZvrOAEEICG7LtS iaFne43SdSFyNjrR7eIYGRCuzfpDw4yabiGESdvRSbemI/v0HFFYFU4xk1GvkuPWW/Ny 5YRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si9601867pge.647.2017.11.10.14.56.09; Fri, 10 Nov 2017 14:56:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754651AbdKJWz3 (ORCPT + 83 others); Fri, 10 Nov 2017 17:55:29 -0500 Received: from gateway24.websitewelcome.com ([192.185.50.45]:20849 "EHLO gateway24.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753825AbdKJWz2 (ORCPT ); Fri, 10 Nov 2017 17:55:28 -0500 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 1192640552 for ; Fri, 10 Nov 2017 16:38:20 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id DHwKeDNEaHEImDHwKeHoX6; Fri, 10 Nov 2017 16:38:20 -0600 Received: from [189.175.248.21] (port=55934 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1eDHwJ-000tu8-Fb; Fri, 10 Nov 2017 16:38:19 -0600 Date: Fri, 10 Nov 2017 16:38:13 -0600 From: "Gustavo A. R. Silva" To: Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] drm/amd/display/dc/core/dc_resource: use swap macro in rect_swap_helper Message-ID: <20171110223813.GA32508@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.175.248.21 X-Source-L: No X-Exim-ID: 1eDHwJ-000tu8-Fb X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.175.248.21]:55934 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 23 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make use of the swap macro instead of _manually_ swapping values and remove unnecessary variable temp. This makes the code easier to read and maintain. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index d1cdf9f..ee216f2 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -426,15 +426,8 @@ static enum pixel_format convert_pixel_format_to_dalsurface( static void rect_swap_helper(struct rect *rect) { - uint32_t temp = 0; - - temp = rect->height; - rect->height = rect->width; - rect->width = temp; - - temp = rect->x; - rect->x = rect->y; - rect->y = temp; + swap(rect->height, rect->width); + swap(rect->x, rect->y); } static void calculate_viewport(struct pipe_ctx *pipe_ctx) -- 2.7.4 From 1586727585803031811@xxx Thu Dec 14 03:15:45 +0000 2017 X-GM-THRID: 1583668314517802827 X-Gmail-Labels: Inbox,Category Forums